Skip to content

Conversation

@coffee-dan
Copy link
Collaborator

Fixes and Features

I really enjoyed this game and have put together this PR in hopes of addressing all of the issues I found while playing. The main issue is mailmap support. Let me know what you think. :)

Fixes

Use name defined in mailmap

See: Git - git-log Documentation author name

To utilize the local mailmap definition of committers the --pretty format string must use %aN.

This resolves #19


Handle bad input

Git game will exit if git itself cannot handle the custom input provided.

image

This is similar to #30


Use up to date Git documentation links

Used in README and help text

Dead link: http://gitref.org/inspect/
Official documentation: https://git-scm.com/docs/git-log


Accept a variety of help args

git game --help and git game -h now accepted

image

New Features


Commit stats

Along with name and date, show a short description of changes.

image


End the game when all commits have been shown

Git game will exit once all commits have been shown, congratulating the user and showing longest streak.

image

This is similar to #30


Prompt user to move on to next question

Enter to go to next question

This is based on feedback I got from friends that the game moves a little too fast.

image

This version took a big performance hit whenver I added shortstat to it. To
counteract that I am only loading in the SHA first and fetching all extra data
after the commit has been selected. This simplifies the commit parsing, allows
for more flexibility with data retrieved and reduces memory footprint of the
game (especially relevant in large repos).
And fixup author trailing whitespace
And use heredocs in favor of multiple puts/prints
And add more options for help command
Based on feedback that time betweem questions is too short
Fix multiple choice shuffling issue that cause indexes to not be lined up
@jsomers
Copy link
Owner

jsomers commented May 4, 2023

Hi, thanks so much for this! Can I ask for one little change: I like showing the "Commit stats" by default, but could you add a command-line argument like --hard where those are once again hidden?

@coffee-dan
Copy link
Collaborator Author

Hi, thanks so much for this! Can I ask for one little change: I like showing the "Commit stats" by default, but could you add a command-line argument like --hard where those are once again hidden?

That sounds perfect! I will add a commit for that later today. :)

coffee-dan added 2 commits May 4, 2023 23:16
Show commit stats by default, this is normal difficulty.
Hide stats when --hard is passed.

Slight refactor of command line args so user can pass --hard and other git
options.
  ex: git game --hard --after={2023-01-01}

And encourage use of --help and -h flags, but still support git game help.
--help does not work when called with git game. It may be getting picked up by
git before git-game has a chance to parse it. I get the message:

  No manual entry for git-game

But it works as expected with git-game --help so I am leaving it in.
@coffee-dan
Copy link
Collaborator Author

@jsomers I added a couple commits for the --hard option. We can call git game with a combination of --hard and any number of git flags. So git game --hard --after={2023-01-01} works perfectly 🎉.

@jsomers jsomers merged commit 7c22180 into jsomers:master May 6, 2023
@coffee-dan
Copy link
Collaborator Author

Thank you for merging! Since there's now a couple new features, it might be a good idea to create a new release and bump the Homebrew formula. What do you think? And if you would like me to take care of any of that for you let me know!

@jsomers
Copy link
Owner

jsomers commented May 13, 2023

If it's not too much trouble for you to take a crack, have at it! Let me know if you need me to make you a collaborator on the repo or anything. (As you can see, I'm pretty slow here :P)

@coffee-dan
Copy link
Collaborator Author

If it's not too much trouble for you to take a crack, have at it! Let me know if you need me to make you a collaborator on the repo or anything. (As you can see, I'm pretty slow here :P)

Ok, I will put together a PR! Being a collaborator would be super helpful for creating a new release, thank you so much. I appreciate your help so far, I didn't even expect a response at all so slow responses are amazing in comparison.

@jsomers
Copy link
Owner

jsomers commented May 20, 2023

@coffee-dan I invited you to be a collaborator. Thanks for the help so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Same author but with different names

2 participants