Hello Community,
I have a concern about the git commit. I don't know if I'm doing it correctly.
When I create HTML webpages, I'm used to committing every time I create a meaningful full small block. For JavaScript, I used to do it line per line.
But things have changed as I was introduced to pseudocode. And I'm confused when I have to commit the creation and "conversion" to JavaScript.
Here is an example of each of the steps I used to create a Rock Paper Scissors game:
STEP 1: Create Big Picture/Main algorithm
What I do is:
1 Create a folder called "algorithm" or "logic" 2 Create a file BIG_PICTURE where I briefly define what my code will do.
-> Big_Picture
Each line I create will be a "sub-algorithm". The Uppercase name at the end represents the name of the sub-algorithm I will work on with pseudocode.
Commit: I commit BIG_PICTURE after I fully create it. Then I commit it with the message "Create BIG_PICTURE basic algorithm"
Questions:
-
Should I rather commit line per line?
-
Is my commit message correct?
STEP 2: Create sub-algorithm
Then I repeat the same process with each sub-algorithm. However, I define in greater detail each step.
-> PLAY_ROUND
Commit: Then when all the algorithm is created, I commit the message "Create PLAY_ROUND basic algorithm"
Questions:
-
Should I rather commit line per line?
-
Is my commit message correct?
Edit algorithm
If I find out that my algorithm/sub-algorithm is wrong (ex: I forgot to create a step). I revise the pseudocode and I change what is needed.
Commit: I commit with the message "Fix PLAY_ROUND algorithm: print 'have a nice day' before if statement in ln 6"
Questions:
-
Is my commit message correct?
-
How can I improve it?
Convert algorithm to code
Once my algorithm is clear, I copy it to app.js as a comment. Then I convert each line of pseudocode to JavaScript code like this:
-> Pseudocode to JavaScript
Because my algorithm was previously defined, I don't feel the need to commit line per line. I rather convert all the pseudocode and commit it once, as I feel more comfortable doing so.
Commit: I commit with the message "Convert PLAY_ROUND algorithm to JavaScript code".
Questions:
-
Should I rather commit line per line?
-
Is my commit message correct?
-
How can I improve the commit message?
Thank you in advance for your feedback 😃
How do people feel about making code edits via web browser
How to Git Commit like a professional Developer?
Commit and Branch Name Generator for Git (with Emoji Support)
Well, in my opinion this doesn't solve any real issue anybody has, but only potentially create bad commit messages. Also I had to read through the readme 3 times and I still don't really know what it does and how it does what you say it does.
But it seems to not be anything for git, but only for github specifically because it uses an issue number?
Also I think you're overdoing it with the emojis, but maybe I'm just too old for that.
More on reddit.comI just got my GitHub contribution wall art from codeprints.dev!
How should I structure a Git commit message?
Git commit messages follow a three-part structure: subject line, body, and footer. The subject line is a one-line summary that appears in logs. Add a blank line, then use the body to explain context and reasoning when needed. The footer is optional and used for referencing issues or marking breaking changes.
What makes a good Git commit message?
A good Git commit message has a clear, descriptive subject line under 50 characters that explains what changed. It uses imperative mood (like "add feature" not "added feature") and includes a body when you need to explain why you made the change. The message should help future readers understand your intent without having to dig through the code.
What are common Git commit message mistakes?
The most common mistakes are vague messages like "fix bug" that tell readers nothing, mixing unrelated changes in one commit, and leaving work-in-progress messages like "WIP" or "temp fix" in the final history. These mistakes make your Git history harder to search and understand. Each commit should contain one logical change with a clear, specific message.