git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ramon Tayag" <ramon.tayag@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org
Subject: Re: Unable to index file
Date: Sat, 13 Dec 2008 04:27:59 +0800	[thread overview]
Message-ID: <f25d5ad20812121227o77cf2bw34e6bc15d9801215@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0812120956050.3340@localhost.localdomain>

Oh thank you for your very detailed explanation.  I was bothering
people on #rubyonrails and #git but got no answers.

I'm on Ubuntu 8.10.  The files I'm working on live on an NTFS drive
(my "storage" drive; yes, I still have to boot into Windows).  If it
being on NTFS makes a difference I'll try this on ext3 and let you
know what happens :)

Thanks,
Ramon Tayag



On Sat, Dec 13, 2008 at 2:07 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
>
> On Fri, 12 Dec 2008, Ramon Tayag wrote:
>>
>> I've come across a problem that I don't believe lies in Rails.  You
>> needn't be familiar, I think, with Rails to see what's wrong.
>>
>> I can't seem to add the files that are in
>> http://dev.rubyonrails.org/archive/rails_edge.zip
>>
>> 1) Unpack the zip
>> 2) Initialize a git repo inside the folder that was unpacked
>> 3) git add .
>>
>> See the errors.. :o http://pastie.org/337571
>
> What platform/filesystem is this?
>
> Git is rather particular about symlinks, and it looks like your platform
> does something odd, and that makes git unhappy about your symlink.
>
> In particular:
>
>        ls -l vendor/rails/actionpack/test/fixtures/layout_tests/layouts/
>        ...
>        lrwxrwxrwx 1 root root 48 2008-12-12 18:22 symlinked -> ../../symlink_parent
>
> notice how the symlink content is "../../symlink_parent", but then take a
> look at the _size_ of the symlink: 48 bytes.
>
> Git expects the lstat() information to match the return from readlink(),
> and it doesn't.
>
> For exact details, see "index_path()" in sha1_file.c:
>
>        case S_IFLNK:
>                len = xsize_t(st->st_size);
>                target = xmalloc(len + 1);
>                if (readlink(path, target, len + 1) != st->st_size) {
>                        char *errstr = strerror(errno);
>
> ie we consider it an error if we get less than st_size characters back
> from readlink().
>
> Now, admittedly git is probably being really annoyingly anal about this
> all, and we probably should loosen the restrictions on it a bit, but I'd
> like to know why it happens. I cannot recall this having been reported
> before, so it's some specific filesystem or OS that causes this, I think.
>
>                Linus
>

  parent reply	other threads:[~2008-12-12 20:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12 14:47 Unable to index file Ramon Tayag
2008-12-12 18:07 ` Linus Torvalds
2008-12-12 18:15   ` Linus Torvalds
2008-12-12 20:27   ` Ramon Tayag [this message]
2008-12-12 20:33     ` Linus Torvalds

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=f25d5ad20812121227o77cf2bw34e6bc15d9801215@mail.gmail.com \
    --to=ramon.tayag@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).