git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Should git-prune-script warn about dircache?
@ 2005-05-01 10:50 Junio C Hamano
  2005-05-01 16:18 ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2005-05-01 10:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

When the user has a change that is recorded in the dircache but
the change has not been committed, git-fsck-cache --unreachable
would report blobs and trees (if you have a subdirectory) that
are involved.

    $ git-init-db
    defaulting to local storage area
    $ date >foo
    $ git-update-cache --add foo
    $ date | git-commit-tree $(git-write-tree) >.git/HEAD
    Committing initial tree 9061076c3ec10fef339c84f4e0c9e06576d3b7db
    $ date >foo
    $ git-update-cache foo
    $ git-fsck-cache --unreachable $(cat .git/HEAD)
    unreachable blob d8c61e975a591ad5905c7defc567a77fca58f092
    $ git-ls-files --stage
    100644 d8c61e975a591ad5905c7defc567a77fca58f092 0 foo

At this point, if we run git-prune-script with the current head,
we would remove the blob, and after that, code that assumes the
objects pointed by SHA1s recorded in the dircache are locally
available start failing.

    $ git-prune-script
    $ touch foo
    $ git-diff-files -p
    .git/objects/d8/c61e975a591....: No such file or directory
    fatal: unable to read blob object for foo (d8c61e975a591....)

I have a feeling somewhere in the chain from git-prune-script we
should have a mechanism to prevent us from losing such blob and
trees.  I know it should not be in git-fsck-cache, but I have
not decided what my suggestions would be for us to do yet.

Maybe a big warning in red ugly bold blinking typeface somewhere
in the doc?


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-05-01 21:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-01 10:50 Should git-prune-script warn about dircache? Junio C Hamano
2005-05-01 16:18 ` Linus Torvalds
2005-05-01 17:20   ` Junio C Hamano
2005-05-01 20:41     ` Junio C Hamano
2005-05-01 21:27       ` [PATCH] Make git-prune-script a bit more careful Junio C Hamano
2005-05-01 21:29   ` [PATCH] Make git-update-cache --refresh fail if update/merge needed Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).