Bug? file at the same time being deleted and not registered
- From
- Tomas Pospisek <tpo_deb@sourcepole.ch>
- Date
- May 23, 2010, 21:09 UTC
- Message-ID
- <alpine.DEB.2.00.1005232245220.18372@tpo-laptop>
(I'm not subscribed, so please in case do Cc: me)
Short version: ==============
$ # we're on a mhddfs backed filesystem here, that doesn't support hardlinks $ mkdir bar $ cd bar/ $ git init Initialized empty Git repository in /mnt/mhddfs/tmp/bar/.git/
$ touch a_file $ git add a_file $ git commit a_file -m bla [master (root-commit) ca0ce50] bla 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 a_file
$ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # deleted: a_file # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # a_file
So we have a file that was committed, that git thinks it's scheduled to be deleted and at the same time is untracked. Doesn't make any sense, does it?
This happens only on the mhddfs backed filesystem. The same procedure works well in /tmp or on plain ext3.
Here's the strace of the commit step (from a identical try):
http://pastebin.com/htUmWYGh
Jan 'jast' Krüger from the git IRC channel spotted in that strace the fact that the 'link' call is failing.
In that case IMHO git should complain and let the user know, that something went wrong and it can't proceed meaningfully.
Long version: =============
$ mkdir bar $ cd bar/ $ ls -la total 8 drwxr-xr-x 2 foo foo 4096 2010-05-23 22:51 . drwxr-xr-x 2 tpo tpo 4096 2010-05-13 19:27 ..
$ git init Initialized empty Git repository in /mnt/mhddfs/tmp/bar/.git/
$ git status # On branch master # # Initial commit # nothing to commit (create/copy files and use "git add" to track)
$ touch a_file $ git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # a_file nothing added to commit but untracked files present (use "git add" to track)
$ git add a_file $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: a_file #
$ git commit a_file -m bla [master (root-commit) ca0ce50] bla 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 a_file
$ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # deleted: a_file # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # a_file