File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,10 @@ class GitChangeLog
92
92
* @var string Path to a base (changelog) file. The generated changelog can be prepend this file.
93
93
*/
94
94
public $ baseFile ;
95
+ /**
96
+ * @var string Format of a single commit hash. {hash} is replaced by the commit hash.
97
+ */
98
+ public $ formatHash = '{hash} ' ;
95
99
/**
96
100
* @var string Value of the oldest tag to include into the generated changelog.
97
101
* @see GitChangeLog::setFromTag()
@@ -270,6 +274,10 @@ public function build(): void
270
274
// Add commit subjects.
271
275
foreach ($ data ['subjects ' ] as $ subjectKey => &$ subject ) {
272
276
if ($ this ->options ['addHashes ' ]) {
277
+ foreach ($ data ['hashes ' ][$ subjectKey ] as &$ hash ) {
278
+ $ hash = str_replace ('{hash} ' , $ hash , $ this ->formatHash );
279
+ }
280
+ unset($ hash );
273
281
$ hashesString = implode (', ' , $ data ['hashes ' ][$ subjectKey ]);
274
282
$ hashesString = str_replace ('{hashes} ' , $ hashesString , $ this ->formatHashes );
275
283
}
You can’t perform that action at this time.
0 commit comments