Created
June 20, 2021 00:34
-
-
Save olekscode/2fecf20e52acb71505e4d5a648e89420 to your computer and use it in GitHub Desktop.
Extract diffs from the commit history between two versions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repositoryName := 'DataFrame'. | |
oldVersionTag := 'v1.0'. | |
newVersionTag := 'v2.0'. | |
repository := (IceRepository registry detect: [ :repo | | |
repo isValid and: [ repo name = repositoryName ] ]). | |
oldCommit := (repository tags detect: [ :tag | tag name = oldVersionTag ]) commit. | |
newCommit := (repository tags detect: [ :tag | tag name = newVersionTag ]) commit. | |
commitWalk := (IceLibgitCommitWalk forRepository: repository) | |
fromCommit: newCommit; | |
uptoCommit: oldCommit; | |
yourself. | |
commits := OrderedCollection new. | |
commitWalk commitsDo: [ :commit | commits add: commit ]. | |
commits add: oldCommit. | |
commits := commits reversed. | |
diffs := OrderedCollection new. | |
(1 to: commits size - 1) | |
do: [ :i | | |
commit := commits at: i. | |
[ diffs add: (commit diffTo: commit parent) ] | |
on: Exception | |
do: [ "Nothing" ] ] | |
displayingProgress: [ :i | i asString, ' / ', commits size asString ]. | |
commit := commits last. | |
diffs add: (commit diffTo: commit parent). | |
diffs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment