pepopowitz’s avatarpepopowitz’s Twitter Archive—№ 1,332

  1. TIL: You can create an empty commit in git. git commit --allow-empty -m "message" Why would you want to do this? 1/5
    1. …in reply to @pepopowitz
      At @ArtsyOpenSource, we use github.com/semantic-release/semantic-release and github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-ember/README.md to automate NPM publishing. So if I merge a commit into master with "[FIX subject]" in the message, our CI publishes a release with a bumped patch version! Handy! 2/5
      1. …in reply to @pepopowitz
        "[FEATURE subject]" in the message publishes a release with a bumped minor version. "[BREAKING subject]" in the message publishes a release with a bumped major version. But still...why does this mean I'd want to create an empty commit???? 3/5
        1. …in reply to @pepopowitz
          I made 3 commits today & forgot about semantic releases. The messages all described the changes, but none triggered a new version. I could've updated the message on 1 - but it meant more semantically to create an *empty* commit with message "[PATCH subject] bump version". 4/5
          1. …in reply to @pepopowitz
            So assuming I didn't screw anything else up 🤷‍♀️ 🤷🏾‍♂️, I should get a new version piublished for the *set* of changes I made - thanks to an empty git commit. Yay, automation! 5/5 Source: github.com/artsy/reaction#commits-and-deployments