All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Aiuto <polinice83@libero.it>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: Can't build first git commit
Date: Thu, 07 Mar 2019 21:07:15 +0100	[thread overview]
Message-ID: <1551989235.1606.3.camel@libero.it> (raw)
In-Reply-To: <20190307194146.GA2453@sigill.intra.peff.net>

Sorry for forgetting the cc!!!
Thank you so much for help, hope not to bore you all ;)
I think that I will go on studying git this way, and follow all the 
improvements that were made along his history. I think that
asymptosis too gave me a good link, related to that bash script
implmentation.
Thank you Jeff, now I'm trying to understand how could I show the
contents of the index in that version.

Fabio.

Il giorno gio, 07/03/2019 alle 14.41 -0500, Jeff King ha scritto:
> [+cc git@vger; let's keep this on the list; I'm not sure there's a
> lot
>  to be learned from fiddling with this old version, but if we're
> going
>  to do it, let's at least record our attempts for posterity]
> 
> On Thu, Mar 07, 2019 at 08:04:55PM +0100, Fabio Aiuto wrote:
> 
> > I made a directory "trial" and inside it I ran init-db (that's the
> > grand-father of git init) inside that directory. Then I created a
> > file 
> > this way:
> > 
> > echo 'helloooo!' >file.txt
> > 
> > then then executed update-cache file.txt (thinking that's the
> > ancestor
> > of git add), but that doesn't work and it returns with a
> > segmentation
> > fault, due to the nullity of the header. But in this first commit
> > how
> > do I add a file in the cache? What's the right way to build up a
> > repository from scratch with commit e83c5163316f?
> 
> Hmm. I tried that, too, and got a segfault. Then I tried it again a
> few
> minutes later, and it worked.
> 
> One thing that seems to provoke it consistently is having a zero-
> length
> index file (because that causes mmap to return NULL, and the code
> does
> not check for that case). Try this:
> 
>   # This works.
>   init-db
>   echo content >file
>   update-cache file
> 
>   # This segfaults
>   >.dircache/index
>   update-cache file
> 
>   # And this works again
>   rm .dircache/index
>   update-cache file
> 
> I'm not sure why it would ever fail without that explicit empty-file
> write. Perhaps there's some code path that writes out an empty index
> file, and we inadvertently triggered it.
> 
> If you're going to play with such an antique commit, you have to
> expect
> that things won't necessarily work, and be ready to poke around in
> the
> debugger.
> 
> -Peff

      reply	other threads:[~2019-03-07 20:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04 19:58 Can't build first git commit Fabio Aiuto
2019-03-04 20:10 ` Santiago Torres
2019-03-04 20:19   ` Fabio Aiuto
2019-03-04 20:22     ` Santiago Torres
2019-03-04 21:48     ` asymptosis
2019-03-04 22:25     ` Jonathan Nieder
2019-03-04 20:40 ` Jeff King
2019-03-05 18:42   ` Fabio Aiuto
2019-03-05 19:15   ` Jeff King
2019-03-06 19:58     ` Fabio Aiuto
2019-03-06 20:03       ` Jeff King
2019-03-06 20:19         ` Fabio Aiuto
2019-03-06 20:39           ` Santiago Torres
2019-03-06 21:54             ` Jeff King
2019-03-06 20:52         ` Fabio Aiuto
2019-03-06 21:57           ` Jeff King
     [not found]             ` <1551985495.1606.1.camel@libero.it>
2019-03-07 19:41               ` Jeff King
2019-03-07 20:07                 ` Fabio Aiuto [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

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

  git send-email \
    --in-reply-to=1551989235.1606.3.camel@libero.it \
    --to=polinice83@libero.it \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.