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

Re: [PATCH] Add suggestion to hard-to-understand error message

From
Junio C Hamano <junkio@cox.net>
Date
Dec 22, 2005, 01:15 UTC
Message-ID
<7vd5jqvsn1.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0512220048360.13453@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Dummies like me do not understand readily that "remote object abcdef...
> does not exist on local" means: "Hey, you did not pull this, did you?".
> So, add "(pull first?)" to that message.

I am ambivalent about this one. It is a special case of "remote is not a strict subset of local" situation, so we might be better if we just said the same as the other error message and be done with it. On the other hand, the code does know the difference of the two situations at this point, and it could be argued that giving the same error is losing information.

Earlier I once rewound the "master" branch head by one commit too much by mistake. The next push to the public server would have given me a different error message, depending on whether I pruned my private repository or not in between. For example, after this sequence:

    $ git commit -m 'initial'
    $ git commit -m 'next'
    $ git push remote master
    $ git reset --hard HEAD^
    $ git commit -m 'third but second'

If you do not prune at this point, then the remote commit "next" still exists in the local repository (but not reachable). Then

    $ git push remote master

would not say "pull first?". But if you prune local repository before pushing, it would now say "pull first?".

In a sense, both are "pull first?" situation, and it probably is more confusing to give different messages to the user in these two cases. From the end-user point of view they are the same "remote is not strict subset.".

Previous: Johannes SchindelinNext: Andreas Ericsson
Message 2 of 7 in “Add suggestion to hard-to-understand error message”
  1. Add suggestion to hard-to-understand error messageJohannes Schindelin, Dec 21, 2005
  2. Junio C HamanoDec 22, 2005
  3. Andreas EricssonDec 22, 2005
  4. Junio C HamanoDec 22, 2005
  5. send-pack: reword non-fast-forward error message.Junio C Hamano, Dec 22, 2005
  6. Johannes SchindelinDec 22, 2005
  7. Andreas EricssonDec 23, 2005

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.