8000 First impressions, things to do before merge into GameShell is possible (long) · Issue #5 · MKessar/GameShell_git · GitHub
[go: up one dir, main page]

Skip to content

First impressions, things to do before merge into GameShell is possible (long) #5

@phyver

Description

@phyver

I finally got around to testing your missions about git.

First, thanks a lot to the both of you for putting in the time to write those! I do happen to know how much work creating missions and testing them requires!

Second, I do like the whole idea a lot and I may want to add them as an "alternative" set of missions in the official GameShell repo at some point. (If you're OK with that.)
That would mean the usual archive can be used with something like

  $ bash gameshell.sh git-missions

to start the git related missions instead of the standard ones.

There are many things to address before that, which probably mean quite a lot of work. I'll be happy to contribute but won't have much time for that before the end of April.
I'm pinging @rlepigre as he may be interested to collaborate as well.

I'll list some of the general remarks I had, and we can discuss them here, and
possibly open specific issues to track progress for some tasks.

  • The whole thing should be translated to French at some point, but that's easy and it can wait.

  • Goal file should use the same formatting convention as the ones in the standard missions. That can wait as well.

  • I'm pretty sure we can make the actual files in the spellbook repo more interesting than lists of numbers!

  • The goal should be stated as clearly as possible, with as little interference from the whole dragon / spider / spell environment. I did struggle on a couple of missions because I wasn't sure what I was supposed to do. That will probably require several tries to get right. (I am still modifying some goals based on user feedback...)

  • Many missions felt a little repetitive because we are always doing the same thing: improving a spell. I wonder if players might not miss some things because they feel they've already done something very similar. There might be some way to have more variety (without making everything too artificial).

  • I expect parsing the output of git commands using grep isn't very robust. (BTW, I think the C locale is probably better suited than the en_GB locale you are using.)
    I don't use it very often, but I think git rev-parse could be used in several places to get a more robust gsh check.

  • The "recommended" way of switching between branches is now git switch rather than git checkout. It might be better to introduce that to beginners.
    (We could check the version of the git command, but I think git switch has existed for more than 5 years, so it's probably not very important.)

  • The semantics of resetting missions should be clear and consistent. If some player at mission 20 does gsh goto 10 (for whatever reason) before gsh goto 20, it shouldn't reset his spellbook repo.
    I haven't checked what you are doing but I wondered, especially since failing some missions did seem to remove some files / commits I had done trying to complete the mission. I think at one point, I had to recommit some file because I didn't end the mission in the spell branch. It felt a little strange...

  • I still haven't completely made my mind up about the "quizz missions". (Mostly about fast-forward vs merge.) First, I think the terminology should be introduced in GameShell, to avoid requiring people to go read about them somewhere else. Second, I think the gsh check command shouldn't only ask yes/no questions, which you automatically get on the second try, but also have what is the closest common ancestor for foo and bar so that we do actually check player have looked at those. (And having those missions optional is probably a good idea...

  • One thing that I felt was missing is a couple of missions about exploring an existing "large" repo. The player could have to track down the last commit by some old magician.

  • Is it a choice from your part not to introduce git init, git stash or .gitignore?
    Based on the way I use git, the missions I'd like to see in GameShell would be something like (that's open for discussion)

    • git_basics for
      • git init and git config
      • git clone
      • add and commit, together with log and status
      • push and pull
      • .gitignore
      • possibly mv and rm
    • git_branch for
      • branch and switch
      • checkout to check old version
      • merge
    • git_misc for
      • stash
      • git diff
      • revert ? (I never use it)
      • git commit --amend
    • git_advanced for
      • reset,
      • rebase,
      • remotes,
      • and possibly some other things (hooks, git alias, ???)

The next point is important for me and may require some redesigning the
overall sequence of missions:

  • We should discuss about the use of remotes. I think a lot of the missions would work just as well with a "local" repository. The repository could be in the world filesystem (in the library for example) or in a "hidden" mission directory (somewhere in $GSH_MISSIONS).
    Those would be more than enough to introduce the concepts of cloning, forking, remotes, etc. The big advantage is that we don't need access to a distant git server and we never need to fiddle with authentification, keys and the like.

  • I still don't know how I feel about introducing pull requests and the like in GameShell as those require using a distant gitlab / github server, and most interaction happens outside GameShell.

  • contrib/git_basics/01_create_newrepo is one mission I'm sure not to ever include in GameShell because of the risk that a private key to someone's real repo ends up in a gameshell archive.
    Not having a key makes interacting with github / gitlab a pain, but I don't see a way around it. And we if we implement "local remotes", the problem goes away...
    The way I see it, the final mission would contain some links for people to get information about that, with a warning about putting a private key in GameShell.

The next points are some specific problems / suggestions that should be easy
to implement.

  • I had a couple of bugs coming from the fact that I played from a directory within the gameshell_git repo. At some point, a git commit did commit into the gameshell_git repo because I wasn't inside the spellbook repo...
    I discovered the existence of the GIT_CEILING_DIRECTORIES environment
    variable. It should be set to $GSH_ROOT to prevent such problem!
    It should be set inside a gshrc file in a dummy 00_config mission.

  • After the glowing_finger ASCII animation, "Control-C" starts exiting GameShell. This was a serious pain for me, as I am used to using "Control-C" to reset the command I am writing in the shell.
    I haven't checked why you do that, but you're trapping SIGINT, which you at least should "untrap" at the end. (Probably with trap INT.)

  • You are using "treasure.sh" as a way to display ASCII animations after some successful missions. That's not what they are for. treasure.sh files are scripts that are added to the starting bashrc file. I use them to define variables, functions or aliases that the user can use from that mission on.
    That explains why all the animations are replayed if you run gameshell from a savefile.
    The file treasure-msg are used to display a simple message (with treasure box ASCII art) to explain that to the user. (See standard mission 3, that adds the current directory in the prompt.)
    Those could be used to add some useful aliases, a couple of missions after the corresponding command have been introduced. The ones I personnaly use most often are: alias gl=git log --oneline, alias gll=git log --stat, alias gs=git status and alias gg=git log --oneline --graph --all. Adding the name of the current branch in the prompt is another nice thing we could gift the player.

  • The ASCII animations could be displayed by the check.sh functions. It would also have the advantage that we wouldn't lose the "mission successful message, which was sometimes hidden by the animation.

There were some even more specific things about individual missions, but that can wait.

Sorry about this long post, and congratulations if you've read this far!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0