codecrafters-io / build-your-own-git Goto Github PK
View Code? Open in Web Editor NEWDefinition for the git challenge.
Home Page: https://app.codecrafters.io/courses/git/overview
License: MIT License
Definition for the git challenge.
Home Page: https://app.codecrafters.io/courses/git/overview
License: MIT License
Logs:
Dec 19 12:49:00 148e5315b37068 vector [stage-5] Creating some files & directories
Dec 19 12:49:00 148e5315b37068 vector [stage-5] $ ./your_git.sh write-tree
Dec 19 12:49:00 148e5315b37068 vector [your_program] aec2d24a22463ac63c7ec9684903f7f5ba292c79
Dec 19 12:49:00 148e5315b37068 vector [stage-5] Reading file at .git/objects/ae/c2d24a22463ac63c7ec9684903f7f5ba292c79
Dec 19 12:49:00 148e5315b37068 vector Error [stage-5] CodeCrafters internal error. Error reading .git/objects/ae/c2d24a22463ac63c7ec9684903f7f5ba292c79: open /tmp/worktree814524593/.git/objects/ae/c2d24a22463ac63c7ec9684903f7f5ba292c79: no such file or directory
Dec 19 12:49:00 148e5315b37068 vector [stage-5] Test failed
Here's our code that's supposed to filter user vs. internal error:
if err == os.ErrNotExist {
return fmt.Errorf("Did you write the tree object? Did not find a file in .git/objects/<first 2 chars of sha>/<remaining chars of sha>")
} else if err != nil {
return fmt.Errorf("CodeCrafters internal error. Error reading %v: %v", relativePath, err)
}
Looks like this specific instance of "no such file or directory" isn't covered by os.ErrNotExist
?
I think the test cases are wrong for C++ since I had to hardcode ignoring all of the files related to CMake. Maybe these files don't exist for whatever language you wrote them in?
Thanks to @ljdannull for highlighting this!
the tests are flaky - they fail and if i run it again with no changes, they pass
[stage-4] Running ./your_git.sh ls-tree --name-only 8eeb4ae8872e3393d1530df8f536f56255b69000
[your_program] doo
[your_program] dumpty
[your_program] Traceback (most recent call last):
[your_program] File "<frozen runpy>", line 198, in _run_module_as_main
[your_program] File "<frozen runpy>", line 88, in _run_code
[your_program] File "/app/app/main.py", line 105, in <module>
[your_program] main()
[your_program] File "/app/app/main.py", line 83, in main
[your_program] mode, path = entry.split(b" ")
[your_program] ^^^^^^^^^^
[your_program] ValueError: too many values to unpack (expected 2)
[stage-4] Expected "doo\ndumpty\nhumpty\n" as stdout, got: "doo\ndumpty\n"
[stage-4] Test failed
[stage-4] Running tests for Stage #4: Read a tree object
[stage-4] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-4] Writing a tree to git storage..
[stage-4] Running ./your_git.sh ls-tree --name-only 0e0e083fd1cd81bb3df04d53e726e2a6a763e6d0
[your_program] doo
[your_program] dumpty
[your_program] yikes
[your_program] Traceback (most recent call last):
[your_program] File "<frozen runpy>", line 198, in _run_module_as_main
[your_program] File "<frozen runpy>", line 88, in _run_code
[your_program] File "/app/app/main.py", line 105, in <module>
[your_program] main()
[your_program] File "/app/app/main.py", line 83, in main
[your_program] mode, path = entry.split(b" ")
[your_program] ^^^^^^^^^^
[your_program] ValueError: not enough values to unpack (expected 2, got 1)
[stage-4] Test passed.
Looks like we aren't testing the exit code?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.