Skip to content

Commit f3513e1

Browse files
committed
Coauthors are now pulled from method/class timeStamps
Fixed project file source directory export.
1 parent 7d1f5c9 commit f3513e1

File tree

30 files changed

+159
-77
lines changed

30 files changed

+159
-77
lines changed
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
accessing
22
allAuthors
3-
^ (self versionsWithPackageNames collect: #second) asSet asArray sorted
3+
allAuthors
4+
ifNil: [ | authorsSet |
5+
authorsSet := Set new.
6+
self versions
7+
do: [ :each | authorsSet addAll: (self authorsInSnapshot: each veryDeepCopy snapshot) ]
8+
displayingProgress: [ :each | 'Loading authors... ' , each info name ].
9+
allAuthors := authorsSet asArray sorted ].
10+
^ allAuthors
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
accessing
22
authors: aCollection
3-
| allAuthors |
4-
allAuthors := self allAuthors asOrderedCollection.
5-
aCollection asDictionary associations
6-
do: [ :pair |
7-
(pair key isEmpty or: [ (pair value size = 2) not ])
8-
ifTrue: [ self error: 'Invalid format' ].
9-
(allAuthors includes: pair key)
10-
ifTrue: [ allAuthors remove: pair key ] ].
11-
allAuthors
12-
ifNotEmpty: [ NotFound new
13-
messageText:
14-
'Not all authors have their email set, this is mandatory: '
15-
, (allAuthors joinUsing: ', ');
16-
object: self;
17-
signal ].
183
authors := aCollection asDictionary
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
accessing
2+
authorsInSnapshot: aSnapshot
3+
| timeStamps |
4+
timeStamps := OrderedCollection new.
5+
aSnapshot definitions
6+
do: [ :each |
7+
each isMethodDefinition
8+
ifTrue: [ timeStamps add: each timeStamp ].
9+
(each isClassDefinition and: [ (each isKindOf: MCClassTraitDefinition) not ])
10+
ifTrue: [ timeStamps add: each commentStamp ] ].
11+
^ (timeStamps collect: [ :each | each copyUpTo: Character space ]) \ #('' '<historical>')

repository/GitMigration.package/GitMigration.class/properties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"cachedVersions",
1212
"completeAncestryCache",
1313
"versionsWithPackageNames",
14-
"versionsCache"
14+
"versionsCache",
15+
"allAuthors"
1516
],
1617
"name" : "GitMigration",
1718
"type" : "normal"

repository/GitMigration.package/GitMigrationCommitInfo.class/class/info.mapping.committer..st

Lines changed: 0 additions & 6 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
instance creation
2+
info: aVersionInfo mapping: aMapping committer: aCommitter coauthors: aCoauthorsList
3+
^ self new
4+
info: aVersionInfo;
5+
author: (aMapping at: aVersionInfo author);
6+
coauthors:
7+
(aCoauthorsList \ {aVersionInfo author}
8+
collect: [ :each | aMapping at: each ]);
9+
committer: aCommitter
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
coauthors: aCollection
3+
coauthors := aCollection
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
coauthors
3+
^ coauthors \ {author}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
accessing
22
commitMessage
3-
^ info message " , ' (' , info versionNumber asString , ') ['
4-
, ((info ancestors collect: #versionNumber) joinUsing: ', ') , ']'"
3+
^ String
4+
<< [ :stream |
5+
stream << info message withUnixLineEndings.
6+
(self coauthors sorted: #name ascending)
7+
ifNotEmpty: [ :co |
8+
stream lf.
9+
stream lf.
10+
co
11+
do: [ :each | stream << 'Co-authored-by: ' << each name << ' <' << each email << '>' ]
12+
separatedBy: [ stream lf ] ] ]

repository/GitMigration.package/GitMigrationCommitInfo.class/properties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"author",
1111
"committer",
1212
"parents",
13-
"branch"
13+
"branch",
14+
"coauthors"
1415
],
1516
"name" : "GitMigrationCommitInfo",
1617
"type" : "normal"

0 commit comments

Comments
 (0)