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

Re: [PATCH] push: Correctly initialize nonfastforward in do_push.

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 16, 2009, 18:29 UTC
Message-ID
<vpqskemagla.fsf@bauges.imag.fr>
In-Reply-To
<7vvdjizrgg.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> Short answer: trust me, without the patch, you get the non-fast
>> forward (and valgrind tells you about conditional jump on
>> uninitialized value), with, you don't ;-).
>
> I understand valgrind one; I can trace the codepath with eyeballs without
> it, and that is why I said it looks correct to begin with.

(in case it wasn't clear, "you" in my message should have been read as "one", no harm intended)

> My puzzlement was that the following in the log message did not seem to
> reproduce for me:
>     ... where "git push ... nonexisting-branch" was complaining about
>     non-fast forward.

It's comming from an uninitialized variable, so it may have worked just "by chance". For me, it seems to do it reproducibly, with for example:

$ mkdir repo $ rm -rf repo/ $ git init repo Initialized empty Git repository in /tmp/repo/.git/ $ cd repo; touch foo; git add .; git commit -m foo > /dev/null $ git push . nonexisting-branch error: src refspec nonexisting-branch does not match any. error: failed to push some refs to '.' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'non-fast forward' section of 'git push --help' for details.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C Hamano
Message 4 of 4 in “Re: [PATCH] push: Correctly initialize nonfastforward in do_push.”
  1. Matthieu MoySep 16, 2009
  2. push: Correctly initialize nonfastforward in do_push.Matthieu Moy, Sep 16, 2009
  3. Junio C HamanoSep 16, 2009
  4. Matthieu MoySep 16, 2009

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.