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, 13:21 UTC
Message-ID
<alpine.LNX.1.00.0803200914420.19665@iabervon.org>
In-Reply-To
<2008-03-20-11-53-31+trackit+sam@rfc1149.net>
On Thu, 20 Mar 2008, Samuel Tardieu wrote:
Show 11 quoted lines
> I am using git master branch locally (1.5.5.rc0.133.g7e207), and the
> server is using 1.5.4.rc3.g16335. I want to push my HEAD~1 revision
> into the 2.0 branch on the server, and it looks like it is not
> expanded anymore in the refspec:
> 
> % git push origin HEAD~1:2.0
> fatal: Invalid refspec 'HEAD~1:2.0'
> fatal: The remote end hung up unexpectedly
> 
> Isn't HEAD~1 supposed to be expanded locally? Using the SHA-1 instead
> of HEAD~1 works fine.

Ah, yes. I added checks for invalid refspecs, and missed that you can use things that are invalid as ref names but valid as object names.

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. For now, you can comment out line 444 (except for a semicolon) to disable the check that's in your way.

	-Daniel
*This .sig left intentionally blank*
Previous: Samuel TardieuNext: Junio C Hamano
Message 2 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.