-
Notifications
You must be signed in to change notification settings - Fork 51
Track commits in .git/gud/commits.json #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Here's what happens as of now:
commit_name => "C#" I haven't built any functions to read the JSON file, but that should be easy enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all pretty good and works perfectly off the bat!
Still, a few code changes
We don't need the reading just yet. It's not clear what we're going to need this for, so we can hold off on doing that until we start running into issues and need this. We'll probably need this when working with rebases and merges and trying to figure out if the user has solved a given level |
- create_tree uses commit_obj variable - System now uses Operator for file navigation - Renamed track_commits to track_commit
Added to handle_init and handle_reset
I need to reset the tracking json whenever there is a new level; I do this for load, reset, and init. Are there any more that I don't know about or am forgetting? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tentative approval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of init_tracking_json
every time, put init_tracking_json
in the load_level
function.
I think it would be more clear if we rename init_tracking_json
to clear_tracked_commits
One more thing. I've uploaded a change to the master branch that will cause a merge conflict in handle_init
but does part of your work for you. My changes reduce redundant code.
You also skipped load_level
in handle_progress
, but that should be fixed when you add init_tracking_json
to load_level
As for testing, write a function that loads a level, reads the json and then just makes sure the dictionary is the correct length. The only level that doesn't have anything fancy in it is the first one, which is just a bunch of commits, so use that one. We won't know the hashes, so this is a good simple test. If you have other ideas, feel free to bring them up.
That's it. Mostly reorganization - the needed functionality is already there.
- Renamed init_tracking_json to clear_tracked_commits - Moved init_tracking_json to load_level, and removed code resulting obsolete code. - Moved track_commit from handle_commit to add_and_commit
All requested changes have been made. In regards to the "test," are you talking about the CircleCI tests? Or a git gud test for the user? |
- Added commits.json attribute to file_operator
fixes #40