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

[BUG] reset abusive symlink removal; possible submodule-add misbehaviour

From
YDYann Dirson <ydirson@linagora.com>
Date
May 11, 2009, 08:59 UTC
Message-ID
<46017.10.0.0.1.1242032359.squirrel@intranet.linagora.com>

This happenned to me while playing with changing from a manual unversionned symlink to a submodule:

~/tmp/super$ ls -la total 16 drwxr-xr-x 3 yann yann 4096 mai 11 10:49 . drwxr-xr-x 4 yann yann 4096 mai 11 10:48 .. drwxr-xr-x 8 yann yann 4096 mai 11 10:49 .git -rw-r--r-- 1 yann yann 4 mai 11 10:48 README lrwxrwxrwx 1 yann yann 6 mai 11 10:49 sub -> ../sub ~/tmp/super$ git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # sub nothing added to commit but untracked files present (use "git add" to track) ~/tmp/super$ ls -la ../sub total 12 drwxr-xr-x 3 yann yann 4096 mai 11 10:48 . drwxr-xr-x 4 yann yann 4096 mai 11 10:48 .. drwxr-xr-x 7 yann yann 4096 mai 11 10:48 .git ~/tmp/super$ git submodule add git://anything sub Adding existing repo at 'sub' to the index ~/tmp/super$ ls -la total 20 drwxr-xr-x 3 yann yann 4096 mai 11 10:50 . drwxr-xr-x 4 yann yann 4096 mai 11 10:48 .. drwxr-xr-x 8 yann yann 4096 mai 11 10:50 .git -rw-r--r-- 1 yann yann 52 mai 11 10:50 .gitmodules -rw-r--r-- 1 yann yann 4 mai 11 10:48 README lrwxrwxrwx 1 yann yann 6 mai 11 10:49 sub -> ../sub

Here I realise the symlink may have had unwanted effects. But shouldn't it have "submodule add" failed here, since the target already exists ?

~/tmp/super$ git reset --hard HEAD is now at abb75d6 foo yann@cyann:~/tmp/super$ ls -la total 16 drwxr-xr-x 3 yann yann 4096 mai 11 10:50 . drwxr-xr-x 4 yann yann 4096 mai 11 10:48 .. drwxr-xr-x 8 yann yann 4096 mai 11 10:50 .git -rw-r--r-- 1 yann yann 4 mai 11 10:48 README

Although not critical, this seems to qualify as data loss.
Message 1 of 1 in “[BUG] reset abusive symlink removal; possible submodule-add misbehaviour”
  1. Yann DirsonMay 11, 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.