Giter Club home page Giter Club logo

Comments (5)

pschanely avatar pschanely commented on May 30, 2024

I'll admit to feeling less strongly about this than the code formatting stuff, but it's about time for me to be making more serious commit messages anyway. Feel free!

from crosshair.

mristin avatar mristin commented on May 30, 2024

It is indeed super minor! In my experience, it gives nice "safety rails" to new contributors. For example, I always look up the commit history to see what commit message format is expected. It is then pretty confusing if the tenses are mixed, and I wonder which tense is expected.

from crosshair.

mristin avatar mristin commented on May 30, 2024

@pschanely could you please re-review? I added a section to the contributing guidelines and included the link in the error message.

I set up the action so that both the commit messages and pull requests must always contain both a subject (i.e. a header or title) and a body. This forced me in practice to write much more informative commit messages.

Most of the times, the developer is at least forced to reference an issue that the commit fixes. Other times, the developer has to write what the problem was (why). This really helps when you need to backtrack. However, I am not so sure if it makes sense to document the history of the code at this point while it is all pretty much in flux.

(I personally think it does pays off given how little effort it takes to write an additional sentence or two in comparison to work that almost all pull requests involve. On the other hand, I also see the other perspective that writing more elaborate commit messages can hinder the creativity and become a barrier to quick changes.)

There is a flag allow-one-liners: 'true' which makes the action permit the commits without a body, so that would enforce the style, but allow for short one-line commit messages. However, the max length of the subject is fixed to 50 characters which is indeed very short and forces almost automatically the developer to write more information in the body. (This is a good thing in my opinion, but again, can work against fast changes since we have to stop and think about writing the commit messages instead of focusing on the code.)

from crosshair.

pschanely avatar pschanely commented on May 30, 2024

I am willing to give this a try! I am doing a lot of untracked work right now, but I expect that to die down over time. I also occasionally have a "remove unused import" commit message that I might struggle to describe, but the benefits probably outweigh a few awkward cases.

from crosshair.

mristin avatar mristin commented on May 30, 2024

I also occasionally have a "remove unused import" commit message that I might struggle to describe, ...

What worked for me in those cases is just to write down in the body that this is a purely cosmetic/formatting commit (which is useful information in its own right). For example, another developer might wonder whether there was something procedural involved in the import as the code would be executed during the import etc.

from crosshair.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.