Giter Site home page Giter Site logo

codecrafters-io / build-your-own-git Goto Github PK

View Code? Open in Web Editor NEW
65.0 65.0 14.0 564 KB

Definition for the git challenge.

Home Page: https://app.codecrafters.io/courses/git/overview

License: MIT License

Shell 18.03% Go 7.23% Rust 4.65% Python 4.08% Ruby 4.28% Kotlin 1.49% Dockerfile 26.00% Makefile 0.18% CMake 1.61% C++ 9.74% JavaScript 5.59% Haskell 5.65% Java 6.82% C# 4.65%

build-your-own-git's People

Contributors

libmartinito avatar nikandfor avatar nixypanda avatar rohitpaulk avatar ryan-gang avatar thetasinner avatar urielsalis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

build-your-own-git's Issues

Tester says "internal error" on stage 5 for a user error

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?

"Read tree" stage tests are flaky

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?

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.