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

git-pull --tags with no merge candidates case gives confusing error message

From
Paul Tan <pyokagan@gmail.com>
Date
May 12, 2015, 05:59 UTC
Message-ID
<CACRoPnQvNvBv1_wBzWQH6A8XRvWZ+HURvtkqtgYpwjjNXuCERg@mail.gmail.com>
Hi all,

Calling git-pull --tags, and hitting the no merge candidates case, currently gives the following error message:

    It doesn't make sense to pull all tags; you probably meant:
        git fetch --tags
This error message comes from the following code block in git-pull.sh:
    for opt
    do
        case "$opt" in
        -t|--t|--ta|--tag|--tags)
            echo "It doesn't make sense to pull all tags; you probably meant:"
            echo "  git fetch --tags"
            exit 1
        esac
    done

This behavior was introduced in 441ed41 ("git pull --tags": error out with a better message., 2007-12-28), which stated that:

    In the longer term, it would be a better approach to change the
    semantics of --tags option to make "git fetch" and "git pull"
    to:
     (1) behave as if no --tags was given (so an explicit refspec on
         the command line overrides configured ones, or no explicit
         refspecs on the command line takes configured ones); but
     (2) no auto-following of tags is made even when using
         configured refspecs; and
     (3) fetch all tags as not-for-merge entries".
    Then we would not need to have this separate error message, as
    the ordinary merge will happen even with the --tags option.

Given that as of c5a84e9 (fetch --tags: fetch tags *in addition to* other stuff, 2013-10-30), git-pull --tags will fetch tags in addition to the configured refspecs, so if there are no merge candidates, it would not be because --tags was specified on the command line.

As such, I wonder if the error message should be removed, since it conceals the actual reason of why there are no merge candidates. Unless there is a reason why this special error message was kept?

Thanks, Paul

Next: Junio C Hamano
Message 1 of 5 in “git-pull --tags with no merge candidates case gives confusing error message”
  1. Paul TanMay 12, 2015
  2. Junio C HamanoMay 12, 2015
  3. pull: remove --tags error in no merge candidates casePaul Tan, May 13, 2015
  4. Michael HaggertyMay 12, 2015
  5. Paul TanMay 13, 2015

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.