cross-posted from: https://lemmy.sdf.org/post/1352760

Was digging through a project at work today where some guy in 2014 made 100+ commits in a single day and the only one that had a comment said “upgrading to v4.0”.

    • Jim@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      Yep, this is the convention. Unfortunately, I’ve never been able to enforce it. Encouraging good git commit messages is probably the bottom of the things I can coach. I’d be happy if commits were properly squashed/rebased and that we all followed the same PR merge strategy.

  • canpolat@programming.devOPM
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    The way I commit on my private branch is different than how I merge those commits to the main branch. When working on the private branch, things can get messy and if they do, I just try to keep certain things separate from each other (refactorings and bug fixes should not go into the same commit). Once the work is done, I do a interactive rebase to tidy things up and then merge them afterwards. Sometimes the changes are not that much and it becomes a squash commit. I would definitely refrain from creating 100 (insignificant and possibly back-and-forth) commits on the main branch.

  • Kissaki@feddit.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 years ago

    Driven through me as Lead Developer, we’ve adopted a Conventional Commits style using convco for conformance check and changelog/release note generating (customized template).

    feat(auth): Introduce configurable permissions (ticketref) (!MR)
    

    We’ve extended allowed/used types of fix and feat to include docs, test, refac, and misc. We explicitly decided against types like @CodeSupreme linked like style, perf, build, ci, chore, revert. Slim number of types has value. build, ci are scoped to misc(proj) or misc(ci). Reverts are of the original type or misc chores with impact - not a disconnected separate type - and indicated in the commit title.

    We develop in branches, and are free to be messy until we found and implemented a solution at which point we clean up commits to an intentional, documented changeset (using Git interactive rebase with squashing etc).

    We use a semi-linear history, so once a changeset is approved we rebase and merge with a merge commit - so we only have at most one merged parallel branch in the history tree. The generated changelog only considers merge commits - where the changeset is documented as a whole (same title and description as the merge/review request).

  • stoehraj@midwest.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    Most of mine tend to follow this format:

    filename: brief description
    
    More in-depth description and rationale if needed
    

    It’s not often where I will modify multiple files within a single commit, but if I do, I will typically use a section or subsystem name rather than a single filename.

  • malloc@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    I follow this format:

    brief description
    
    - change1
    - change2
    
    
    

    I add the issue number since most decent issue trackers with integrated VCS (ie, github, bitbucket + jira) will automatically hyperlink it to the actual issue

  • unknowing8343@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    As someone said in the original post: Conventional Commits. No more discussion is needed. Just do it like the standard and get back faster to the real work.