]> source.dussan.org Git - jgit.git/commit
CherryPick: add ability to customise cherry-picked commit message 14/1172614/7
authorDmitrii Naumenko <dmitrii.naumenko@jetbrains.com>
Wed, 22 Nov 2023 18:11:17 +0000 (19:11 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 28 Jan 2024 15:13:32 +0000 (16:13 +0100)
commitc646649257070cd1707b7e86887e50c5acafa86c
treec7211b1548a6e02bf36bb39bac542b20e2597793
parent74471b8d755bdfe15a0585e49e1449788b4fc843
CherryPick: add ability to customise cherry-picked commit message

Originally I wanted to support a feature similar to `-x` options from
https://git-scm.com/docs/git-cherry-pick#_options.
The idea was to append original commit hash in this format:
```
my original commit message

(cherry picked from commit 75355897dc28e9975afed028c1a6d8c6b97b2a3c)
```
This can be useful information in some integrations.
I decided to make it in a more generic way
and pass custom `CherryPickCommitMessageProvider` implementation.
One of the two default implementations can append original commit hash

Change-Id: Id664e8438b0b76c5cb9b58113887eec04aa6f611
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommitMessageProvider.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java