Giter VIP home page Giter VIP logo

Comments (8)

sirnewton01 avatar sirnewton01 commented on June 17, 2024

I tried reproducing the scenario on Mac with the latest dgit and I get this message.

Mode does not match type: 100644 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 0 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa*...*q

I'm not sure if the panic is hidden underneath or if I'm seeing a different case because of Mac.

from dgit.

sirnewton01 avatar sirnewton01 commented on June 17, 2024

I get this panic after I add using official git and I try dgit to read the status.

$ ../dgit status
panic: TODO: I can't handle such long names yet

goroutine 1 [running]:
github.com/driusan/dgit/git.ReadIndexEntry(0xc4200b2038, 0x2, 0x2, 0xc4200a0cc0)
/Users/cmcgee/go/src/github.com/driusan/dgit/git/index.go:168 +0x25c
github.com/driusan/dgit/git.GitDir.ReadIndex(0xc4200b0180, 0x35, 0x0, 0x0, 0x0)
/Users/cmcgee/go/src/github.com/driusan/dgit/git/index.go:106 +0x304
github.com/driusan/dgit/git.StatusLong(0xc4200a2d50, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0xc4200a61e0, 0x22, 0x0, ...)
/Users/cmcgee/go/src/github.com/driusan/dgit/git/status.go:124 +0x75
github.com/driusan/dgit/git.Status(0xc4200a2d50, 0x100000000, 0x301, 0x13403c9, 0x7, 0x0, 0x0, 0x0, 0xc420063a00, 0x1012368, ...)
/Users/cmcgee/go/src/github.com/driusan/dgit/git/status.go:73 +0x320
github.com/driusan/dgit/cmd.Status(0xc4200a2d50, 0xc4200b6010, 0x0, 0x0, 0x1, 0x0)
/Users/cmcgee/go/src/github.com/driusan/dgit/cmd/status.go:96 +0x766
main.main()
/Users/cmcgee/go/src/github.com/driusan/dgit/main.go:242 +0x3630

from dgit.

driusan avatar driusan commented on June 17, 2024

Yeah, the case isn't handled and has an explicit panic. I tried just reading blocks of 8 bytes until one ended in nil (see comment above the panic in normal sized case), but it led to a corrupt index, so there's slightly more to it than that, but that's definitely at least part of it.

from dgit.

sirnewton01 avatar sirnewton01 commented on June 17, 2024

I tried some variations of ignoring the nameLength and just read in the name bytes until encountering a null byte and also accounting for the 8 byte (+4, no +4) boundaries, but no success so far. I can't seem to find any index file format description that covers insanely long file names. I mean, even Linux and Mac don't support file names with this length. I'm tempted to skip over this one test in the basic suite since it seems like such an edge case.

from dgit.

sirnewton01 avatar sirnewton01 commented on June 17, 2024

Although, this doesn't address this particular enhancement request, I have added a patch that will skip the test for now as part of PR #61

from dgit.

sirnewton01 avatar sirnewton01 commented on June 17, 2024

Here is how a popular Java git implementation handles the long file names: https://github.com/eclipse/jgit/blob/f3ec7cf3f0436a79e252251a31dbc62694555897/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java#L174

from dgit.

sirnewton01 avatar sirnewton01 commented on June 17, 2024

When someone looks at this please remove the GIT_IGNORE_TESTS entry in .travis.yml for it "t0000.77" so that the test can verify the long filename support.

from dgit.

driusan avatar driusan commented on June 17, 2024

Should be fixed by #68

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.