Giter VIP home page Giter VIP logo

Comments (9)

sirnewton01 avatar sirnewton01 commented on September 23, 2024 1

I have attached the repo where I see the hang.

badrepo.zip

from dgit.

driusan avatar driusan commented on September 23, 2024 1

I downloaded the repo to look into it:

100644 f87290f8eb2cbbea7857214459a0739927eab154 0	path0
100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0	path2/file2
100644 0aa34cae68d0878578ad119c86ca2b5ed5b28376 0	path3/file3
100644 00fb5908cb97c2564a9783c0c64087333b3b464f 0	path3/subp3/file3

Seems like a relatively hard index for the recursive algorithm. There should probably be a (dgit) test case that covers it too.

from dgit.

driusan avatar driusan commented on September 23, 2024 1

That took longer than I care to admit for a fix that ended up being trivial, but I added test cases for this now, and it seems to be good.

from dgit.

driusan avatar driusan commented on September 23, 2024

Looks like an infinite loop. Is the repo from the git test suite or one that you created organically?

from dgit.

sirnewton01 avatar sirnewton01 commented on September 23, 2024

It's one of the ones from the git test suite. t0000-basic. Instructions are here: https://github.com/driusan/dgit/wiki/Verify-dgit-using-official-git-tests

from dgit.

sirnewton01 avatar sirnewton01 commented on September 23, 2024

I enabled an fmt.Printf statement that was commented out in git/writetree.go. It's getting stuck like this:

This name: path0
This name: path2/file2
This name: file3
This name: path2/file2
This name: path2/file2
This name: path2/file2
This name: path2/file2
This name: path2/file2
This name: path2/file2
...

Also, the recursion seems to be in a section where it says that it has found the end of the tree, it's just trying to get the SHA-1 hash.

from dgit.

sirnewton01 avatar sirnewton01 commented on September 23, 2024

It's recursing on line 139 but before it gets there it is hitting line 125

from dgit.

driusan avatar driusan commented on September 23, 2024

What are prefix and newprefix at line 139? Line 125 is supposed to ensure that at least 1 part of the path is always stripped off to prevent this loop. And in the index are there 1 or more than 1 files under path2? git ls-files -c -s will tell you exactly what's in the index that it's trying to convert into a tree.

from dgit.

sirnewton01 avatar sirnewton01 commented on September 23, 2024

Here's what I get when I dump prefix and new prefix at line 139:

prefix: path3/path2 newprefix: path3/path2/path2
prefix: path3/path2/path2 newprefix: path3/path2/path2/path2
prefix: path3/path2/path2/path2 newprefix: path3/path2/path2/path2/path2
...

from dgit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.