Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 4, 2020 11:07 pm GMT

Git blame should be called git credit

Positive language

Language is important, really important. How we express our ideas and our desires has a big impact on how our words will be received. Positive statements get more quickly received by the audience, but they are also well-received.

Which of these would you like to hear better?

  • Please don't be late at the restaurant tonight.
  • Please be on time at the restaurant tonight.

  • 66% chances you won't die, 33% chances you will die.

  • 66% chances it will save you, 33% chances you will be saved.

Well, in both cases I'd rather hear the second version of those statements. In the second set, it is known as the framing effect. You'll be more likely to choose the option with the positive connotations rather than the option with the negative ones.

git blame

Ok, back to our software things. The reason I got to think about this was because of git blame. Isn't it kind of strange that they went with a negative word such as blame for the command?

Here is the definition for blame:

feel or declare that (someone or something) is responsible for a fault or wrong.

responsibility for a fault or wrong.

Ew, that's not really joyful. But what's the point of the git blame command anyway?

According to the git documentation:

git-blame - Show what revision and author last modified each line of a file

So, git blame tells you who wrote what code in a specific file. But there are no mention that it's to find a fault or wrong doing. We just want to find who wrote some code!

Why go with negative language when we could have something positive?

Here comes credit!

Here is the definition for credit:

publicly acknowledge a contributor's role in the production of (something published or broadcast).

Well, that's a lot more positive! Maybe I want to find who wrote that code so I can congratulate her on such a beautifully crafted piece of engineering.

You know who wrote that 6 months ago?

You. You did. Give yourself some credit you rockstar

Aliasing

Turns out it's not that complicated if you are some weird person like me who likes to use positive language in your git commands. We can use some alias!

All you have to do is run this command:

git config --global alias.credit blame

Now, git credit does the same job as git blame!

It's a tiny tiny change. But it makes me feel happy to use positive language whenever I can

Have fun


Original Link: https://dev.to/damcosset/git-blame-should-be-called-git-credit-27h5

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To