Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Alex Vandiver <alex@chmrr.net>,
	git discussion list <git@vger.kernel.org>
Subject: Re: "fatal: git-write-tree: error building trees" from `git stash`
Date: Thu, 27 Dec 2012 12:11:37 -0800	[thread overview]
Message-ID: <7vhan7l0g6.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20121227190542.GB28811@sigill.intra.peff.net> (Jeff King's message of "Thu, 27 Dec 2012 14:05:42 -0500")

Jeff King <peff@peff.net> writes:

> but I suspect it is not sufficient:
>
>   1. There are other code paths that will end up in write-tree which
>      should probably be protected, too.

Among 6 calls to write-tree, only the first ones in create_stash and
apply_stash are about the index the user originally had.  If the
only expected failure case is unmerged entries, it should be
sufficient to protect these two (and the one in apply_stash is
already covered, I think).

>   2. Unmerged entries are only one reason that write-tree might fail.
>      It's OK not to catch them all (since ultimately write-tree will
>      complain if need be), but we may want to also handle intent-to-add
>      entries with a nicer message.

Hrmph.

We used to fail write-tree when I-T-A entries existed and relied on
that behaviour to implement "no state lost"; as we broke write-tree
recently by allowing to write a tree out by pretending that I-T-A
entries do not exist, I think we broke it.  Stashing with I-T-A and
then unstashing it may lose the file.  Sigh...

  reply	other threads:[~2012-12-27 20:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-27 18:07 "fatal: git-write-tree: error building trees" from `git stash` Alex Vandiver
2012-12-27 18:51 ` Junio C Hamano
2012-12-27 18:55   ` Alex Vandiver
2012-12-27 19:05     ` Jeff King
2012-12-27 20:11       ` Junio C Hamano [this message]
2012-12-27 19:21     ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=7vhan7l0g6.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=alex@chmrr.net \
    --cc=git@vger.kernel.org \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox