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

Re: Invalid refspec?

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 20, 2008, 17:12 UTC
Message-ID
<alpine.LNX.1.00.0803201256080.19665@iabervon.org>
In-Reply-To
<7vy78dwdh2.fsf@gitster.siamese.dyndns.org>
On Thu, 20 Mar 2008, Junio C Hamano wrote:
Show 7 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > We need a test for the src being an object name around line 443 in 
> > remote.c; I'll have something this evening if nobody beats me to it.
> 
> Careful.  That is ONLY valid for pushes.  For fetches, you are allowed to
> name existing refs and nothing else.

I think it's okay to make "HEAD~1:foo" *valid* a fetch refspec; it'll be rejected a bit further along, but there's no particular need to give a different error for "HEAD~1:foo" versus "e83c5163316f89bfbde7d9ab23ca2e25604af290:foo" based on the presence of a ~. Sure, we can figure out a little bit earlier that it's not going to work, but I don't think that's really enough to make it important that parse_ref_spec reject it.

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “Invalid refspec?”
  1. Samuel TardieuMar 20, 2008
  2. Daniel BarkalowMar 20, 2008
  3. Junio C HamanoMar 20, 2008
  4. Daniel BarkalowMar 20, 2008
  5. Junio C HamanoMar 20, 2008

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.