git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Johannes Sixt <j6t@kdbg.org>,
	Manuel Guilamo <manuel.guilamo@publicis.com.do>,
	git@vger.kernel.org
Subject: Re: Prevent reset --hard from deleting everything if one doesn't have any commits yet
Date: Sun, 03 Mar 2019 10:38:00 +0900	[thread overview]
Message-ID: <xmqqa7ic3fgn.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190301134759.GA13402@sigill.intra.peff.net> (Jeff King's message of "Fri, 1 Mar 2019 08:47:59 -0500")

Jeff King <peff@peff.net> writes:

> Wouldn't that mean all of the file data is available in the object
> database? Unfortunately without an index, there's nothing to mark which
> file was which. But `git fsck --lost-found` should copy out all of the
> file content into .git/lost-found.

If we had a hierachically stored index that stores subdirectory
contents as a tree (or some tree-like things), "fsck --lost-found"
would have been able to recover even pathnames, but with the current
flat index in a fresh directory without any commit, we'd get bunch
of blobs without any clue as to where each of them goes.  It would
be far better than nothing, but leaves room for improvement.

      reply	other threads:[~2019-03-03  1:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 21:43 Prevent reset --hard from deleting everything if one doesn't have any commits yet Manuel Guilamo
2019-03-01  6:56 ` Johannes Sixt
2019-03-01 13:46   ` Manuel Guilamo
2019-03-01 13:47   ` Jeff King
2019-03-03  1:38     ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa7ic3fgn.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=manuel.guilamo@publicis.com.do \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).