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

Re: error pushing stash ?

From
Jeff King <peff@peff.net>
Date
Oct 28, 2008, 21:23 UTC
Message-ID
<20081028212327.GA25358@sigill.intra.peff.net>
In-Reply-To
<20081028211755.GA8074@sigill.intra.peff.net>
On Tue, Oct 28, 2008 at 05:17:55PM -0400, Jeff King wrote:
Show 7 quoted lines
> Since no version of receive-pack accepts these "funny refs", perhaps we
> should mirror the check when considering the list of refs to send. IOW,
> don't even make them eligible for matching or mirroring. Patch is below.
> [...]
> +	/* we already know it starts with refs/ to get here */
> +	if (check_ref_format(refname + 5))
> +		return 0;

It occurs to me that since I didn't give a good commit message, and since I replied to a several-weeks-old message, this might be confusing. But what I am suggesting is that git-push should not bother trying to send something that it knows git-receive-pack will refuse. So this check goes into builtin-send-pack.c, and is an exact mirror of the one in builtin-receive-pack.c:

 $ sed -n 177,181p builtin-receive-pack.c
        /* only refs/... are allowed */
        if (prefixcmp(name, "refs/") || check_ref_format(name + 5)) {
                error("refusing to create funny ref '%s' remotely", name);
                return "funny refname";
        }
-Peff
Previous: Jeff KingNext: david@statichacks.org
Message 4 of 8 in “error pushing stash ?”
  1. David BrysonOct 7, 2008
  2. Shawn O. PearceOct 7, 2008
  3. Jeff KingOct 28, 2008
  4. Jeff KingOct 28, 2008
  5. Added test case for mirror to not push stash refsdavid@statichacks.org, Nov 6, 2008
  6. Sverre RabbelierNov 6, 2008
  7. Junio C HamanoNov 6, 2008
  8. Added test case for mirror to not push stash refsdavid@statichacks.org, Nov 6, 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.