GDQuest / meta

A repository to talk about GDQuest at large, guidelines, etc. all in one place. This is where public discussions that don't belong to a specific repository go.
GNU General Public License v3.0
13 stars 3 forks source link

Standardizing & conventions #30

Closed razcore-rad closed 4 years ago

razcore-rad commented 4 years ago

Legend:

So here I'm thinking for anything that's related to this, including stuff on gdquest.com or github repos, code, documents, videos pretty much anything where text appears.

Starting off with the GDquest organization on GitHub, we have a combination of names like BPSRender, Blender-power-sequencer, even the organization is called GDquest as opposed to GDQuest. All this needs to be "fixed". I think it's best to keep this issue opened for the time being and gather all in a list, much like godotengine/godot#16863 - and tick off as we work on it.

I personally prefer camel case so I'd stick with BPSRender vs. say bps-render, but I'm not a sticker for this so if you guys like the other name type (- separated) that's all fine. My point with camel case is that the main GDQuest logo & name is also camel case so makes sense to stick with it. It's really part of the identity by now.

So with that in mind:

Another option would be to have repo names like: GDQuest/godot-V3.1NewFeatures, GDQuest/blender-PSProxy or even GDQuest/blenderPSProxy. That is, when we work with a specific product, like Godot, Blender, Krita etc. we could make a distinction based on that, with the repo name starting with the product name - distinct from the rest of the "regular" CamelCase name of the repo. Or have a 3 letter code for a product: GDQuest/bps-Proxy?! Here, the product is actually BlenderPowerSequencer. So the above names is to start a conversation about them, it's not that we have to do it this way.

For repos with version in them, say GodotV3.1, I placed the version at the end but it probably makes more sense to have: GDQuest/Godot3.1NewFeatures or GDQuest/godot3.1-NewFeatures or GDQuest/gdt3.1-NewFeatures if we go with the 3-letter product code.

To clarify:

GDquest organization repos: image

Team repos: image

NOTE: keep in mind that all these changes will break the links on the repos so we have to do some communication beforehand, especially with well followed repos (like OpenRPG say)

NathanLovato commented 4 years ago

keep in mind that all these changes will break the links on the repos

For some yes, but Github is nice in that when you rename a repo, it creates a redirect page for you.

So it's mostly for links to specific branches or what-not that may break, not sure.

Regarding the naming conventions, web-style-names are readable for everyone, the dashes only replace spaces between the words, while pascal case is a developer's thing, something I would expect we're comfortable with because of our experience as developers.

Let's compare side-by-side:

Pascal case Web case
GodotNewFeaturesV3.1 godot-new-features-v3.1
PDFInvoiceGenerator pdf-invoice-generator
GodotYourFirst2DPlatformer godot-your-first-2d-platformer

I find the right column more readable. Besides that everything seems good to me.

razcore-rad commented 4 years ago

Yeah, you're right and I agree, web-style-names are way easier to read. We just need to figure out the convention and get to making the changes gradually. Consistency is key I've been told :)

NathanLovato commented 4 years ago

@GDQuest/core I just fixed the organization's name, you'll have to update your repositories

You can automate that with the following shell code, starting from the topmost directory that contains all your git repositories.

⚠ this will directly modify your remotes, be cautious!

You can replace the line git remote set-url origin $url_new with echo $url_new to double-check it won't mess up your remotes:

working_directory=$(pwd)
for i in $(find -name '.git' -type d)
do
    cd $(dirname $i)
    url_current=$(git remote get-url origin)
    url_new=$(echo $url_current | sed 's/GDquest/GDQuest/')
    if [ "$url_current" != "$url_new" ]; then
        git remote set-url origin $url_new
    fi
    cd $working_directory
done

This will work with bash, zsh, and should also work with git bash on windows.

NathanLovato commented 4 years ago

I moved old repositories and forks to my personal account.

razcore-rad commented 4 years ago

Yeah, I don't think this is actually needed in this case cause I don't think web links are case sensitive, but we'll see thanks.

About the other stuff I want to talk about I'll wait for a (audio) chat on Discord, it will go much faster than having a text-based conversation here.

NathanLovato commented 4 years ago

@GDQuest/core I renamed all the repositories, please use the following bash script below to change your origin remotes.

This will directly modify your repos' remotes, be cautious!

To test the output of the script, remove git remote set-url origin and the following backticks around echo $url_current | sed "s/$string_match/$string_replace/"

Start from the topmost directory that contains all your git repositories to run the script. It will find all subdirectories with a .git folder and try to rename the remotes there.

Copy and paste the following code in bash, zsh, or maybe in a posix compliant shell. Git bash may work as well. The code uses the expr program that, I believe, comes with bash, but I'm not sure:

renames="GDquest-website,website
BPSRender,blender-sequencer-multithreaded-render
Blender-power-sequencer,blender-power-sequencer
2019-godot-kickstarter,godot-kickstarter-2019
Your-First-Game-Godot-2d-Platformer,godot-beginner-2d-platformer
BPSProxy,blender-proxies-generator
make-pro-2d-games-with-godot,godot-make-pro-2d-games
Godot-engine-tutorial-demos,godot-demos
gdquest-projects,meta
godot-new-features-3.1,godot-new-features-v3.1
free-game-sprites,game-sprites
free-krita-brushes,krita-free-brushes
Tileset-Templates,krita-tileset-templates
Blender-power-sequencer-docs,blender-power-sequencer-docs
godot-3-guides,godot-guides-v3.0"

working_directory=$(pwd)
for i in $(find -name '.git' -type d)
do
    cd $(dirname $i)
    url_current=$(git remote get-url origin)
    url_suffix=`expr match "$url_current" '.*/\(.*\).git'`
    for i in $renames;
    do
        string_match=`expr match "$i" '\(.*\),'`
        string_replace=`expr match "$i" '.*,\(.*\)'`
        [ "$url_suffix" == "$string_match" ] && git remote set-url origin `echo $url_current | sed "s/$string_match/$string_replace/"`
    done
    cd $working_directory
done