File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -147,9 +147,11 @@ class GitChangeLog
147
147
* noChangesMessage Message to show when there are no commit subjects to list for a tag.
148
148
* addHashes True includes commit hashes to the listed subjects.
149
149
* includeMergeCommits True includes merge commits in the subject lists.
150
+ * tagOrderBy Specify on which field the fetched tags have to be ordered.
150
151
* tagOrderDesc True to sort the tags in descending order.
151
152
* commitOrder Set to 'ASC' or 'DESC' to sort the subjects in resp. ascending/descending order.
152
153
* </pre>
154
+ * @see https://git-scm.com/docs/git-for-each-ref
153
155
*/
154
156
protected $ options = [
155
157
'logHeader ' => "# Changelog \n\n" ,
@@ -158,6 +160,7 @@ class GitChangeLog
158
160
'noChangesMessage ' => 'No changes. ' ,
159
161
'addHashes ' => true ,
160
162
'includeMergeCommits ' => false ,
163
+ 'tagOrderBy ' => 'creatordate ' ,
161
164
'tagOrderDesc ' => true ,
162
165
'commitOrder ' => 'ASC ' ,
163
166
];
@@ -192,7 +195,7 @@ public function fetchTags($force = false): array
192
195
}
193
196
194
197
// Get all git tags.
195
- $ this ->gitTags = explode ("\n" , shell_exec ("git tag --sort=-creatordate " ));
198
+ $ this ->gitTags = explode ("\n" , shell_exec ("git tag --sort=- { $ this -> options [ ' tagOrderBy ' ]} " ));
196
199
array_pop ($ this ->gitTags ); // Remove empty element.
197
200
198
201
$ toKey = $ this ->toTag == 'HEAD ' ? 0 : array_search ($ this ->toTag , $ this ->gitTags );
You can’t perform that action at this time.
0 commit comments