Comments (8)
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.
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.
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.
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.
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.
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.
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.
Should be fixed by #68
from dgit.
Related Issues (20)
- Add support for local configuration parameters specified using "-c" global option
- Add log support for -n and -format options HOT 4
- Enhance fetch subcommand with -f and multiple groups HOT 4
- Clone is freezing when cloning from one local repo to another HOT 3
- Freeze cloning from a local repository HOT 6
- Support for git fetch depth HOT 1
- Hierarchical tags and branches aren't working properly HOT 1
- Slice bounds out of range error while running the t5510-fetch tests
- Fetch is not fetching to a destination specified by the remote.<repoid>.fetch config HOT 6
- Panic while cloning repo HOT 7
- git library is noisy HOT 2
- Unable to push - object not found HOT 7
- go master branch not invoking dgit HOT 1
- Could not find origin/master HOT 9
- panic while adding .gitignore HOT 1
- Can not index inflated thin packs
- go get fails due to bitbucket HOT 2
- dgit clone breaks on ARM64 (seems to relate to broken assumptions about memory safety/locking?)
- Migrate from Travis to GitHub Actions HOT 1
- module is not pure Go
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dgit.