DebianJoe / dungeons

Roguelike Project in Python w/ libtcod
13 stars 5 forks source link

Useful git commands #28

Open wesleywerner opened 11 years ago

wesleywerner commented 11 years ago

Some useful git commands to make your life easier. Please feel free to add your own :)

commands

pretty log

git log --pretty=oneline --abbrev-commit --since "2 days ago"

What it does: Shows a summary of commits for the last 2 days

the script

As bonus we can re-use these commands by placing them in your .bashrc as a function. This one I called gg, and it can be expanded on with more commands :)

example

    dungeons $ gg log
    6 hours ago by DebianJoe (349fa3b):
      added logic for recall to town

    8 hours ago by Joe (6c9d061):
      Merge pull request #27 from wesleywerner/install-update

    16 hours ago by Wesley Werner (75f0814):
      details on cloning from HTTP or SSH
Frostlock commented 11 years ago

cool :) I learned some more about merging tonight, interesting!

@DebianJoe you probably know the fork graph but if not, check out this link: https://github.com/DebianJoe/dungeons/network you can see I merged my code nicely in my own repo, ready for you to pull in. Of course if you have additional branches open they may still be a bit challenging to merge.

wesleywerner commented 11 years ago

Hey that is a Nice graph. Good work on that monster classes Frost! :)

It is an interesting thing to consider for a dungeon crawler: hard code monster data or configurable, and how is the best way to load it?

Pythonic way (which I did not follow btw) is to pass a dictionary of values. Guess we learn each time, lol.

Frostlock commented 11 years ago

IMO definately not hardcoded. It should be an external library. I think a pure dictionary approach might be less flexible, allthough I don't understand 100% how this would work. I really like what you built with the config file. Pairing a file like that with and interface class like MonsterLibrary is for me a clean solution. This provides easy access via the interface but also easy manual edit of the config file. As it gets bigger we can even split it up: MonsterLibrary --> monsters.config ItemsLibrary --> items.config

On Tue, Jun 18, 2013 at 7:27 AM, wesley notifications@github.com wrote:

Hey that is a Nice graph. Good work on that monster classes Frost! :)

It is an interesting thing to consider for a dungeon crawler: hard code monster data or configurable, and how is the best way to load it?

Pythonic way (which I did not follow btw) is to pass a dictionary of values. Guess we learn each time, lol.

— Reply to this email directly or view it on GitHubhttps://github.com/DebianJoe/dungeons/issues/28#issuecomment-19591618 .

DebianJoe commented 11 years ago

Dictionary approach would be to have {"HP": 40, "MP": 50} and then use localized variables to call key checks, I'd believe. As you added more stats, you could just slap them into the dict without having to reformat your calls to them. I can see this working, but I'm not 100% that it would be any easier. The mixing of info might get pretty wild at times. I've not tried it, though. Could be really cool.

Also, I'd been watching the graph. It's a pretty neat representation of what's actually going on.

wesleywerner commented 11 years ago

I can't figure out why my commits do not show in that graph. Do I submit my pull requests differently? I push to my fork and request from there. should I push to the main repo instead? Curious... edit: ah because graph shows currently commits that are not in the repo you look at, neat :)

Oh fyi I have been trying out this ConfigObj module, supports nested sections, super neat.

Frostlock commented 11 years ago

Hmm strange I saw my MonsterWork branch all the way to the left, then I refreshed main and merged MonsterWork branch in main in my repo. That made it "catch" up with the main branch.