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

Re: Can I fetch an arbitrary commit by sha1?

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2014, 16:52 UTC
Message-ID
<xmqqwq8bizzi.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141007131257.GA24348@lanh>
Duy Nguyen <pclouds@gmail.com> writes:
> Hmm.. Junio already did most of the work in 051e400 (helping
> smart-http/stateless-rpc fetch race - 2011-08-05), so all we need to
> do is enable uploadpack.allowtipsha1inwant and apply this patch
Not that patch, I would think.

I would understand "if !stateless_rpc and !allowtipsha1 then it is an error", though.

Show 23 quoted lines
> -- 8< --
> diff --git a/upload-pack.c b/upload-pack.c
> index c789ec0..493f8ee 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -454,10 +454,6 @@ static void check_non_tip(void)
>  	char namebuf[42]; /* ^ + SHA-1 + LF */
>  	int i;
>  
> -	/* In the normal in-process case non-tip request can never happen */
> -	if (!stateless_rpc)
> -		goto error;
> -
>  	cmd.argv = argv;
>  	cmd.git_cmd = 1;
>  	cmd.no_stderr = 1;
> -- 8< --
>
> If we already let smart-http do this, I don't see any harm in letting
> git protocol do the same (even though it's the the original reason why
> this code exists).
> --
> Duy
Previous: Duy NguyenNext: Duy Nguyen
Message 10 of 12 in “Can I fetch an arbitrary commit by sha1?”
  1. Christian HalstrickOct 2, 2014
  2. Dan JohnsonOct 2, 2014
  3. Jeff KingOct 2, 2014
  4. Jonathan NiederOct 2, 2014
  5. Christian HalstrickOct 5, 2014
  6. Patrick DonnellyOct 6, 2014
  7. David LangOct 6, 2014
  8. Duy NguyenOct 7, 2014
  9. Duy NguyenOct 7, 2014
  10. Junio C HamanoOct 7, 2014
  11. Duy NguyenOct 8, 2014
  12. Junio C HamanoOct 9, 2014

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.