# error: git checkout-index: unable to write file

2 messages from 2010-11-04 to 2010-11-04. Participants: Jonathan Nieder, Jeff King.
Thread: https://gitlist.dev/t/25645

## Jonathan Nieder, 2010-11-04 19:00

Subject: error: git checkout-index: unable to write file
Message-ID: <20101104190007.GA17101@burratino>
URL: https://gitlist.dev/e/20101104190007.GA17101%40burratino

```
Hi gitsters,

Just tried cloning an enormous repo to /tmp (which uses tmpfs)
and got

 error: git checkout-index: unable to write file webkit/tools/test_shell/resources/textAreaResizeCorner.png
 error: git checkout-index: unable to write file webkit/tools/test_shell/run_all_tests.cc
 error: git checkout-index: unable to write file webkit/tools/test_shell/simple_appcache_system.cc
 error: git checkout-index: unable to write file webkit/tools/test_shell/simple_appcache_system.h

[etc].

Maybe we can do better?  It seems non-ideal in a few ways:

 1) it is not checkout-index but read-tree -m that prints the message
 2) errno is forgotten
 3) I would prefer if "git clone" errored out quickly for ENOSPC instead
    of continuing to fill in the cracks with what small files it can
    find.  Though I suppose the current behavior is better for errors
    like EPERM and ENAMETOOLONG, so I can't complain much.

```

## Jeff King, 2010-11-04 19:22

Subject: Re: error: git checkout-index: unable to write file
Message-ID: <20101104192238.GA2381@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20101104192238.GA2381%40sigill.intra.peff.net
In-Reply-To: <20101104190007.GA17101@burratino>

```
On Thu, Nov 04, 2010 at 02:00:07PM -0500, Jonathan Nieder wrote:

> Maybe we can do better?  It seems non-ideal in a few ways:
> 
>  1) it is not checkout-index but read-tree -m that prints the message

I would prefer that it print out "clone" if anything. But those "git
checkout-index" bits appear to be hard-coded in entry.c, probably from
some long-ago cut and paste. Yuck.

Probably it should just be:

   ("error: unable to write %s: %s", file, strerror(errno))

>  2) errno is forgotten

Yup, that is poor.

>  3) I would prefer if "git clone" errored out quickly for ENOSPC instead
>     of continuing to fill in the cracks with what small files it can
>     find.  Though I suppose the current behavior is better for errors
>     like EPERM and ENAMETOOLONG, so I can't complain much.

I'm not sure that the "try to get whatever files you can out" is ever
particularly useful, since the result is a broken repository. But if we
do subscribe to the theory that such a thing may be useful, I think it
can also be useful with ENOSPC. Consider a repository with a bunch of
small files and one giant file. If the giant file fails, you might want
to still be able to read the other stuff.

Again, that is assuming such a partial checkout is even useful. You can
always still pick things manually out of the index or the object db if
you really want to see them.

-Peff

```
