-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start of Pure Git experiment with PureGitRepository, PureGitCommit an…
…d PureGitTag
- Loading branch information
Showing
3 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Extension { #name : #PureGitCommit } | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitCommit >> gtDetailsFor: composite [ | ||
<gtView> | ||
^ composite columnedList | ||
title: 'Details'; | ||
priority: 30; | ||
items: [ { | ||
{ 'Commit' . self id }. | ||
{ 'Parents' | ||
. self ancestorIds asCommaString | ||
. self ancestorIds collect: [ :each | self repository resolveCommit: each ] }. | ||
{ 'Author' . self author }. | ||
{ 'Timestamp' . self timestamp }. | ||
{ 'Comment' . self comment } | ||
} ]; | ||
column: 'key' text: #first; | ||
column: 'value' text: #second weight: 3; | ||
send: #last | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
Extension { #name : #PureGitRepository } | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitRepository >> exampleGToolkit [ | ||
<gtExample> | ||
<noTest> | ||
|
||
self location: (IceRepository repositoryNamed: 'gtoolkit') location. | ||
|
||
self assert: self exists. | ||
|
||
^ self | ||
] | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitRepository >> exampleGt4Git [ | ||
<gtExample> | ||
<noTest> | ||
|
||
self location: (IceRepository repositoryNamed: 'gt4git') location. | ||
|
||
self assert: self exists. | ||
|
||
^ self | ||
] | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitRepository >> exampleGt4GitRootCommit [ | ||
<gtExample> | ||
<noTest> | ||
|
||
| rootCommit | | ||
|
||
self exampleGt4Git. | ||
|
||
rootCommit := self resolveCommit: '9cfbcd6a921f237abc14446d565cc440a60793e8'. | ||
|
||
self assert: rootCommit isRoot. | ||
self assert: rootCommit id = '9cfbcd6a921f237abc14446d565cc440a60793e8'. | ||
self assert: rootCommit commitId = '9cfbcd6a921f237abc14446d565cc440a60793e8'. | ||
self assert: rootCommit author = 'George Ganea'. | ||
self assert: (rootCommit comment includesSubstring: 'created a new repo'). | ||
|
||
^ rootCommit | ||
] | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitRepository >> gtDetails [ | ||
^ { | ||
{ 'location' . self location ifNil: [ 'not set' ] . self location }. | ||
{ 'exists' . self exists } | ||
} | ||
] | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitRepository >> gtDetailsFor: composite [ | ||
<gtView> | ||
^ composite columnedList | ||
title: 'Details'; | ||
priority: 20; | ||
items: [ self gtDetails ]; | ||
column: 'key' text: #first; | ||
column: 'value' text: #second weight: 3; | ||
send: #last | ||
] | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitRepository >> gtLogFor: composite [ | ||
<gtView> | ||
|
||
^ composite columnedList | ||
title: 'Log'; | ||
priority: 30; | ||
items: [ self log ]; | ||
column: 'Commit' text: [ :commit | commit id ]; | ||
column: 'Timestamp' text: [ :commit | commit timestamp ]; | ||
column: 'Author' text: [ :commit | commit author ]; | ||
column: 'Comment' text: [ :commit | commit comment ] | ||
] | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitRepository >> gtTagsFor: composite [ | ||
<gtView> | ||
|
||
^ composite columnedList | ||
title: 'Tags'; | ||
priority: 40; | ||
items: [ self tags ]; | ||
column: 'Name' text: [ :tag | tag name ]; | ||
column: 'Commit' text: [ :tag | tag commitId ] | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Extension { #name : #PureGitTag } | ||
|
||
{ #category : #'*GToolkit4Git' } | ||
PureGitTag >> gtDetailsFor: composite [ | ||
<gtView> | ||
^ composite columnedList | ||
title: 'Details'; | ||
priority: 30; | ||
items: [ { | ||
{ 'Name' . self name ifNil: [ '' ] . self name }. | ||
{ 'Commit' . self commitId . self commit } | ||
} ]; | ||
column: 'key' text: #first; | ||
column: 'value' text: #second weight: 3; | ||
send: #last | ||
] |