Enhance changelog builder tool

This commit is contained in:
Laurent Destailleur 2019-02-15 16:04:29 +01:00
parent 534d3c7350
commit fbdbb6343c
2 changed files with 9 additions and 7 deletions

View File

@ -38,7 +38,7 @@ We officially support versions N, N − 1 and N − 2 for N the latest version a
Choose your base branch accordingly. Choose your base branch accordingly.
### General rules ### General rules
Please don't edit the ChangeLog file. File will be generated from your commit messages during release process by the project manager. Please don't edit the ChangeLog file. File will be generated from all commit messages during release process by the project manager.
### <a name="commits"></a>Commits ### <a name="commits"></a>Commits
Use clear commit messages with the following structure: Use clear commit messages with the following structure:
@ -56,13 +56,15 @@ You can add it to your git configuration using:
git config --local commit.template .gitmessage git config --local commit.template .gitmessage
``` ```
where
#### Keyword #### Keyword
In uppercase if you want to have the log comment appears into the generated ChangeLog file. In uppercase if you want to have the log comment appears into the generated ChangeLog file.
The keyword can be ommitted if your commit does not fit in any of the following categories: The keyword can be ommitted if your commit does not fit in any of the following categories:
- Fix: for a bug fix - Fix/FIX: for a bug fix
- Close: for closing a referenced feature request - New/NEW: for an unreferenced new feature (Opening a feature request and using close is prefered)
- New: for an unreferenced new feature (Opening a feature request and using close is prefered) - Close/CLOSE: for closing a referenced feature request
#### Issuenum #### Issuenum
If your commit fixes a referenced bug or feature request. If your commit fixes a referenced bug or feature request.

View File

@ -361,12 +361,12 @@ if ($nboftargetok) {
} }
if (! $BUILD || $BUILD eq '0-rc') # For a major version if (! $BUILD || $BUILD eq '0-rc') # For a major version
{ {
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
} }
else # For a maintenance release else # For a maintenance release
{ {
#print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; #print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\'| sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
} }
print "\n"; print "\n";