Examples
Importing the module
# Import the CommitFusion module if from PSGallary or chocolatey
Import-Module CommitFusion
# OTHER IMPORT METHODS
# Import the module from the cloned repository
Import-Module -Name .\CommitFusion.psd1
# or use the .psm1 file
Import-Module -Name .\CommitFusion.psm1
# Embed the module into your powershell profile
using module .\CommitFusion.psm1
New-Commit Examples
chore Commit Message Minimum Parameters
Generate a chore commit message with the
2required parametersTypeandDescription
New-Commit -Type chore
Will Ouput:
🔧 chore: Tooling, Generic commit
docs type Commit Message
Generate a docs type commit message add notes
Note: The
-Footerswitch is used to include the footer, use-GitUserto include the git user in the footer after@
New-Commit -Type docs -Description "Documentation" -Scope "add" -Notes "Note 1","Note 2" -GitUser sgkens -Footer
Will Ouput:
📝 docs(add): Documentation
📜 NOTES:
✏ Note 1
✏ Note 2
👤 @sgkens 📅 10:25AM, Monday 31th July 2023
BugFix type Commit Message
Generate a bugfix commit message with
scope. the bugfix typesemverproperty ispatchand is automatically included.
New-Commit -Type fix -Description "Fixed Bug" -Scope "#234" -BugFixes "Fixed Bug #234"
Will Ouput:
🐛 fix(#234): Fixed Bug
🧰 Build: patch
🐛 BUGFIXES:
🦠 Fixed Bug #234 ..🖊
Feat type Commit Message 1
Generate a feat commit message with
scope,notes,bugfixes
New-Commit -Type feat -Description "Feature Addition" -scope "v0.1.0" -Notes "Note 1","Note 2"
Will Ouput:
✨ feature(v0.1.0): Feature Addition
🧰 Build: minor
📜 NOTES:
✏ Note 1
✏ Note 2
Feat, type Commit Message 2
Generate a Changes Type Commit Message with
scope,notes,feature addition,gituserandfooter
New-Commit -Type feat -Description "Feature Additions" -scope "v0.1.0" -Notes "Note 1","Note 2" -FeatureAdditions "Feature Addition 1","Feature Addition 2" -GitUser sgkens -Footer
Will Ouput:
✨ feature(v0.1.0): Feature Additions
🧰 Build: minor
📜 NOTES:
✏ Note 1
✏ Note 2
🌟 FEATURE ADDTIONS:
🍠 Feature Addtion 1
🍠 Feature Addtion 2 ..🖊
👤 @sgklens 📅 12:16AM, Monday 31th July 2023
changes, type Commit Message
Generate a changes Commit message with type
changeswithscope,notes,feature addition,Feature Updates,Bracking Changes,gituserandfooter, changes type is aMajorand will have a semver value ofmajor
New-Commit -Type feature -Description "My New Commit Message" -Scope "v0.1.0" -Notes "Note 1","Note 2" -FeatureAdditions "Feature Addtion 1","Feature Addtion 2" -FeatureNotes "Feature Note 1","Feature Note 2" -BugFixes "bugFix #234", "fixes #23" -BreakingChanges "Breaking Change 1" -GitUser sgkens -Footer
Will Ouput:
✨feat(v0.1.0): My New Commit Message
🧰 Build: minor
📜 NOTES:
✏ Note 1 \
✏ Note 2 \
🌟 FEATURE ADDTIONS:
🍠 Feature Addtion 1 \
🍠 Feature Addtion 2 ..🖊
🐛 BUG FIXES:
🦠 bugFix #234 \
🦠 fixes #23 ..🖊
🧪 FEATURE UPDATES:
🔨 Feature Note 1 \
🔨 Feature Note 2 ..🖊
💢 BREAKING CHANGES:
🧨 Breaking Change 1 ..🖊
👤 @sgkens 📅 8:20AM, Monday 4th December 2023
Set-Commit Example
Appling Commit Message
To Apply Commit Message, you can PIPE
New-CommitintoSet-Commitwich just rungit commit -m $message,New-Commitwill return astringthat can be piped intoSet-Commit
New-Commit @params | Set-Commit
Format-FusionMD Example
Format-FusionMD - Format in Markdown
Format in Markdown, you can PIPE
New-CommitintoFormat-FusionMD
New-Commit @params | Format-FusionMD
Update-Changelog Example
Update-Changelog - Adding Commit Message to changelog
Adding Commit Message to changelog, you can PIPE
New-CommitintoFormat-FusionMDintoUpdate-ChangeLog -logfile $fileby default the file ischangelog.mdif you want to change the file name you can use the-logfileparameter. Message is pre-pended to the file
New-Commit @params | Format-FusionMD | Update-Changelog -logfile .\changelog.md
Get-CommitTypes Example
Get-CommitTypes - Retreiving the CI-SET List Git Mojis
Retreiving the Types from the
CommistFusion.jsonfile, you can use the-NoSemVer,-Major,-Minor,-Patchparameters to filter the list
Get-CISetFusion Types with semver None
Get-CISetFusion -NoSemVer # Returns Types that have no Semver value
Get-CISetFusion Types with semver Major
Get-CISetFusion -Major # Returns Types that have a Semver value of Major
Get-CISetFusion Types with semver Minor
Get-CISetFusion -Minor # Returns Types that have a Semver value of Minor
Get-CISetFusion Types with semver patch
Get-CISetFusion -Patch # Returns Types that have a Semver value of Patch
Git-Emoji Example
Get-Emoji 🐛 from the GitMojis.json file.
Get-Emoji -Type gitmojis -name bug
Will Ouput:
🐛
Get-Emoji 🧑 the miscmojis.json file.
Get-Emoji -Type miscmojis -name person
Will Ouput:
🧑
Get-Emoji
Get-Emoji from the GitMojis.json or miscmojis.json file.
Get-Emoji -Type gitmojis -name bug
Will Ouput:
🐛
Get-GitAutoVersion
Get-GitAutoVersion
(Get-GitAutoVersion).Version
Will Ouput:
Version ParsedLines
------- -----------
0.1.4 105
0.1.4
Using all cmdlets with PIPES
New-Commit -Type feat `
-Description "Added new feature" `
-Scope "add" `
-Notes "Note 1","Note 2" `
-BugFixes "BugFixes 1","BugFixes 2" `
-FeatureNotes "FeatureNotes 1","FeatureNotes 2" `
-FeatureAddtions "FeatureAddtions 1","FeatureAddtions 2" `
-BreakingChanges "BreakingChanges 1","BreakingChanges 2" `
-GitUser "GitUser" `
-GitGroup "GitGroup" `
-Footer | Format-FusionMD | Update-Changelog -logfile .\changelog.md | Set-Commit