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

Re: git-fetch --update-head-ok ?

From
Junio C Hamano <junkio@cox.net>
Date
Oct 11, 2006, 05:25 UTC
Message-ID
<7vzmc3whir.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061003123452.GK2871@admingilde.org>
Martin Waitz <tali@admingilde.org> writes:
> I have no idea why there is a --update-head-ok, but the code looks
> like it has a typo:
I looked at it again, and indeed it looks like a typo.
Show 9 quoted lines
> @@ -433,7 +433,7 @@ esac
>  # If the original head was empty (i.e. no "master" yet), or
>  # if we were told not to worry, we do not have to check.
>  case ",$update_head_ok,$orig_head," in
> -*,, | t,* )
> +*,, | ,t,* )
>         ;;
>  *)
>         curr_head=$(git-rev-parse --verify HEAD 2>/dev/null)

Interestingly enough, when update_head_ok is set, orig_head never is so the typo does not matter at all by pure accident (it was there from the very first version that introduced this feature).

It should just be something like this:
        case "$orig_head" in
        '')
                ;;
        ?*)
                curr_head=$(git-rev-parse --verify HEAD 2>/dev/null)
                ...
Previous: Martin Waitz
Message 2 of 2 in “git-fetch --update-head-ok ?”
  1. Martin WaitzOct 3, 2006
  2. Junio C HamanoOct 11, 2006

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.