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

Bug in git citool when staging symlink as replacement for submodule

From
Adam Spiers <git@adamspiers.org>
Date
Jun 1, 2012, 10:31 UTC
Message-ID
<CAOkDyE9q1n=oLoEXXxurDjNM0B2+cZ9eoeGE57F9hEQUjK0hZg@mail.gmail.com>

I found some strange behaviour in git citool when trying to stage a symlink into the index as a replacement for a (non-registered) submodule. I just reproduced with latest master (1.7.11.rc0.55.gb2478aa):

    mkdir repo
    cd repo
    git init
    echo foo > one
    git add one
    git commit -m'first commit'
    mkdir two
    cd two
    git init
    echo foo > submodule-file
    git add submodule-file
    git commit -m'first submodule commit'
    cd ..
    git add two
    git commit -m'second commit'
    rm -rf two
    ln -s one two
    git citool
At this point, git citool outputs:
    error: Unhandled submodule diff marker: {@@ }
    error: Unhandled submodule diff marker: {+on}

Now if I press Control-T to try to stage 'two' into the index, I get a new dialog which says:

    Updating the Git index failed. A rescan will be automatically
    started to resynchronize git-gui.
    error: two is already a gitlink, not replacing
    fatal: Unable to process path two
                              [Unlock Index] [Continue]

I can work around via 'git add two', but it would be nice if citool handled this correctly.

Thanks! Adam

Next: Heiko Voigt
Message 1 of 7 in “Bug in git citool when staging symlink as replacement for submodule”
  1. Adam SpiersJun 1, 2012
  2. git-gui: recognize submodule diff when replaced by fileHeiko Voigt, Jun 9, 2012
  3. update-index: allow overwriting existing submodule index entriesHeiko Voigt, Jun 9, 2012
  4. Junio C HamanoJun 11, 2012
  5. Jens LehmannJun 11, 2012
  6. Heiko VoigtJun 12, 2012
  7. Jens LehmannJun 12, 2012

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.