A
A
arzamas-nick2019-02-18 10:04:20
git
arzamas-nick, 2019-02-18 10:04:20

What is the best way to write messages in the /git comit -m"" command?

Let's say we have a block:

<div class="block">
    <div class="block__element1">1</div>
    <div class="block__element2">2</div>
  </div>

Then I add another element to this block:
<div class="block">
    <div class="block__element1">1</div>
    <div class="block__element2">2</div>
    <div class="block__element3">3</div>
  </div>

Suppose that:
1st email. this is the title,
2nd email. this image,
and the 3rd email. this is a description (text).
I do not quite understand how to write a commit correctly so that it is clear to me and others. Write in commits directly what is done in the code (what changes are made in the editor), or write how these changes will be displayed visually?
For example:
Option 1: Adds a block__element3 element to the block block;
Option 2: Adds text with a description to the block block;

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2019-02-18
@arzamas-nick

A good description usually has two parts. One describes why this change is needed: what was the problem / what was missing / what did not work. The second describes the decision and documents why that decision was chosen.
And this rule works both ways: if it's impossible to describe why the change was made, or why it's the way it is, it's most likely a bad change.

Option 1: Adds a block__element3 element to the block block;
Option 2: Adds text with a description to the block block;

Both are equally useless, as is this commit itself, apparently.

I
Iloveski, 2019-02-18
@Iloveski

Do you use Jira or similar? If yes, please write the task number from there. And so, it is better to write at a higher level, to explain why the changes were made in the code, that is, option 2 is closer.

V
Vitsliputsli, 2019-02-18
@Vitsliputsli


I do not quite understand how to write a commit correctly so that it is clear to me and others.

Something like this:
"PROJ-237. Added product description on the page 'About the product'"
and, if possible, better in English. PROJ-237 is the task number in your favorite project management system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question