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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]