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

Bug? file at the same time being deleted and not registered

From
TPTomas 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
Next: Jeff King
Message 1 of 9 in “Bug? file at the same time being deleted and not registered”
  1. Tomas PospisekMay 23, 2010
  2. Jeff KingMay 23, 2010
  3. Tomas PospisekMay 24, 2010
  4. Jeff KingMay 24, 2010
  5. Tomas PospisekMay 24, 2010
  6. Jeff KingMay 24, 2010
  7. Tomas PospisekMay 24, 2010
  8. Tomas PospisekMay 24, 2010
  9. Tomas PospisekMay 24, 2010

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.