Gazler / githug

Git your game on!
MIT License
6.86k stars 1.03k forks source link

Branch names with dashes between the words #248

Open duianto opened 5 years ago

duianto commented 5 years ago

Most if not all branch names have used underscores between the words until level 42.

But in: Name: rebase_onto Level: 41 Difficulty: **

One of the branch names readme-update uses a dash between the words. The other branch wrong_branch uses an underscore.

When searching in this githug repository for readme-update, then two files are listed:

levels/rebase_onto.rb has 3 instances: https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/levels/rebase_onto.rb#L22 https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/levels/rebase_onto.rb#L36-L37

spec/githug_spec.rb has 2 instances: https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/spec/githug_spec.rb#L241-L242

While scrolling through spec/githug_spec.rb, I noticed another branch that also use dashes: long-feature-branch

levels/merge_squash.rb has 3 instances: https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/levels/merge_squash.rb#L2 https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/levels/merge_squash.rb#L11 https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/levels/merge_squash.rb#L37

spec/githug_spec.rb has 1 instance: https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/spec/githug_spec.rb#L270

And while writing this I noticed this name new-feature, but I'm not sure if it's a branch name or a git command name. It's listed 1 time here: https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/spec/githug_spec.rb#L252

And 4 times here: https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/levels/cherry-pick/.githug/logs/HEAD

I didn't open a PR because I'm not sure if one/some/all dash names are there for a reason.

Gazler commented 5 years ago

Well spotted, thanks for opening this. As the levels were contributed from many contributors, it is likely that some had their own convention for branch names. I'd be happy for a PR that standardises this to use dashed-branch-names instead of underscored_branch_names.

duianto commented 5 years ago

To start with, the https://github.com/Gazler/githug#writing-levels section should mention that branch names should use dashes, so that any new levels that are created will use that style.

duianto commented 5 years ago

Should repository names and tags also use dashes?

my_cloned_repo https://github.com/Gazler/githug/blob/6b4c41d8080409e154889209b7e41aaf53c6e2a6/levels/clone_to_folder.rb#L2-L5

tag_to_be_pushed https://github.com/Gazler/githug/blob/2544b01546d00165cd7f7059b965be85e1e15006/levels/push_tags.rb#L16

duianto commented 5 years ago

The find_old_branch level has 4 branches:

blowup_sun_for_ransom
cure_common_cold
kill_the_batman
solve_world_hunger

they seem to be listed here: https://github.com/Gazler/githug/tree/2544b01546d00165cd7f7059b965be85e1e15006/levels/find_old_branch/.githug/refs/heads

can they be renamed directly or is there some git commands somewhere else that creates them?

duianto commented 5 years ago

The conflict level calls the branch mybranch https://github.com/Gazler/githug/blob/6b4c41d8080409e154889209b7e41aaf53c6e2a6/levels/conflict.rb#L2 https://github.com/Gazler/githug/tree/2544b01546d00165cd7f7059b965be85e1e15006/levels/conflict/.githug/refs/heads

Should it be called my-branch to match the other branch names?

Gazler commented 5 years ago

Should repository names and tags also use dashes?

I think that makes sense.

can they be renamed directly or is there some git commands somewhere else that creates them?

They can be renamed directly, the files are a reference to a sha, so should be fine.

Should it be called my-branch to match the other branch names?

Sounds good to me!