1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Git commit messages

Discussion in 'Civ4 - Caveman 2 Cosmos' started by billw2015, Sep 8, 2019.

  1. billw2015

    billw2015 Chieftain

    Joined:
    Jun 22, 2015
    Messages:
    477
    As you maybe noticed I added automatic changelog generation for the SVN commits.
    To help with this I have added a system that can improve these logs if we follow some simple rules in our commit messages.
    If you want your commit to appear in a particular section of the generated log then you should use this format:

    section(scope): message​

    section should be one of these (we can add more if we want):
    • feat - a new feature
    • fix - a fix for a bug
    • balance - balance changes
    • perf - performance improvements
    scope is an optional extra piece of information that further categorizes the change.

    Some examples should clarify:


    These will show up something like:

    v40.0.400-alpha - 2019-09-08


    Features
    • Units: Added new crossbow wielding ninja stealth unit
    • Buildings: Removed obsolete building texts
    • Added new production popup
    Fixes
    • Events: Tornadoes no longer spawn in space
    Balance
    • Buildings: Pharmacy gold generation more inline with the buildings it replaces
    Performance Improvements
    • AI building evaluation optimized
    All Changes
    • feat(Units): Added new crossbow wielding ninja stealth unit
    • feat(Buildings): Removed obsolete building texts
    • feat: Added new production popup
    • fix(Events): Tornadoes no longer spawn in space
    • balance(Buildings): Pharmacy gold generation more inline with the buildings it replaces
    • perf: AI building evaluation optimized
    • Improved changelog generation
    Following this pattern isn't required to get your message into the change log, as you can see there is the All Changes section listing everything. It DOES however make it a lot easier for players to see if bugs etc. that they are interested in are fixed, what game play changes to expect etc.
    Also as you can imagine when it comes to making a major release like v40 this is going to make it a lot easier (not that we shouldn't also manually tweak the changelog for a full release, but this will help a lot)!

    You can change commit messages on commits you have not yet pushed to github (in GK just select the commit and click on the message), but after they go to github changing them is quite difficult.
     
    Last edited: Sep 8, 2019
    Anq, raxo2222 and KaTiON_PT like this.
  2. alberts2

    alberts2 Chieftain

    Joined:
    Aug 16, 2012
    Messages:
    1,929
    Gender:
    Male
    Location:
    Germany
    Last edited: Sep 8, 2019
  3. billw2015

    billw2015 Chieftain

    Joined:
    Jun 22, 2015
    Messages:
    477
    It uses a regex to parse the three parts out, so it would only work at the beginning or end of the commit summary.

    I don't really see why, they make the log clearer, they add easy search terms, and allow you to visually filter by what you are interested in.
    I can imagine it takes a bit to get used to, but its designed to be human readable, and this is not something I came up with my self, it is a fairly popular convention:
    https://www.conventionalcommits.org/en/v1.0.0-beta.4/#summary
    https://github.com/conventional-changelog/conventional-changelog

    /edit Also of course it wouldn't be every commit, only those we want to call out to players specifically.
     
    Last edited: Sep 8, 2019
  4. alberts2

    alberts2 Chieftain

    Joined:
    Aug 16, 2012
    Messages:
    1,929
    Gender:
    Male
    Location:
    Germany
    Does this also apply to pull requests and issues?
     
  5. billw2015

    billw2015 Chieftain

    Joined:
    Jun 22, 2015
    Messages:
    477
    No I don't think so, neither of those are recognized by the generator (it just generates a URL from the #number).

    The Pull Request merge commit could use this if you want to call out the whole pull request, but the merge would include the commits that were in the merged branch anyway so it probably isn't necessary.
     
  6. billw2015

    billw2015 Chieftain

    Joined:
    Jun 22, 2015
    Messages:
    477
    No one except me and alberts are going to do this then? I see a bunch of commits that players would probably care about, if you put "fix:" or "balance:" at the start of the commit message then they will see them easily. If you don't then they will be in a sea of unordered commits that nobody is going to read. Its useful for the SVN commit messages, but really its main use is going to be in major release changelog where there is 1000+ commit messages (already there is 350 since we started on git).
     
    TaylorItaly likes this.
  7. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    15,591
    Gender:
    Male
    Location:
    Western IL. cornfields
    Don't expect it anytime soon from me. And when I am ready to do a commit I may have to give the file to someone that is familiar with How to do a proper Commit.
     
  8. billw2015

    billw2015 Chieftain

    Joined:
    Jun 22, 2015
    Messages:
    477
    Don't worry I'm certain you will be able to manage it, if you got the game running from git! Committing is a lot easier:
    1. Make sure you are up to date (hit fetch/pull/update)
    2. Check the check boxes next to the files you want to commit (or more like uncheck any you don't want to commit)
    3. Type a message in the commit message box (start it with fix:, feat: or balance: if you want players to notice it)
    4. Click commit, then click push
    I will make a quick video/gif of the whole thing when I get home.
     
  9. KaTiON_PT

    KaTiON_PT Warlord

    Joined:
    Jan 2, 2010
    Messages:
    1,052
    Location:
    Portugal
    I will, just need to get used to writing that on the summary. :)
     
    billw2015 likes this.
  10. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    25,862
    Gender:
    Male
    Location:
    Las Vegas
    I'll make sure to have this manual open when I try to commit next time and see if I can't start trying to adapt to the approach.
     
    TaylorItaly likes this.
  11. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    25,862
    Gender:
    Male
    Location:
    Las Vegas
    Sorry I didn't use this on my latest... no issues were generated first that this last push would interact with and I wanted to get these in before I leave the house here so there's a little pinch in time on this.
     
  12. billw2015

    billw2015 Chieftain

    Joined:
    Jun 22, 2015
    Messages:
    477
    No issues are required, apparently I didn't explain this well: You literally just type 'fix:', 'feat:', or 'balance:' at the start of the commit description and *that's it*.
    It doesn't need to correspond with an existing issue or whatever, just type those few letters and it lets the changelog generator lay them out better.

    upload_2019-9-15_10-0-16.png
     
  13. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    25,862
    Gender:
    Male
    Location:
    Las Vegas
    I didn't have time to reread the post at that moment was the thing. But that simplifies the explanation. I suppose this would've been a balance: item based on these categories. And it goes in the headline rather than as items in the description? So what if it's more than one of the 3?
     
  14. billw2015

    billw2015 Chieftain

    Joined:
    Jun 22, 2015
    Messages:
    477
    We can add whatever ones we want, there is actually fix, feat. balance and perf currently. You can add context as I described like balance(tech) or fix(units). If you want other categories we can add them but then it becomes more difficult to remember. "feat" is pretty general, anything that isn't a fix can pretty much always be classified as a feature (either a new one, or an update to one that isn't already covered by balance).
     
    KaTiON_PT likes this.

Share This Page