Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
691efb8
First working code. - No handling of subdirectories yet - Not checked…
ThierryGoubier Feb 28, 2018
09d2a15
- Correct missing .st files
ThierryGoubier Feb 28, 2018
c6f551d
Small correction
ThierryGoubier Feb 28, 2018
c6a9682
Added package properties
ThierryGoubier Feb 28, 2018
b0ea440
Write initializers...
ThierryGoubier Feb 28, 2018
added2f
Ensure unix line endings. Add initializers
ThierryGoubier Feb 28, 2018
4b08ffb
Writing organization in chunk format. Strange: my gitfiletree referen…
ThierryGoubier Feb 28, 2018
80bb4e0
Added old thingy serialize package
ThierryGoubier Feb 28, 2018
dbdbdff
Added code for handling sub directories inside the git repository.
ThierryGoubier Feb 28, 2018
b545a13
Add some memoization to avoid too many calls to OSProcess / Git
ThierryGoubier Feb 28, 2018
3658f2d
- Missing extension class generation - Do not utf8Encode internally (…
ThierryGoubier Feb 28, 2018
951150d
Added proper handling of dependencies
ThierryGoubier Feb 28, 2018
579e59c
Refactoring the fast-import part inside MCFileTreeGitRepository
ThierryGoubier Feb 28, 2018
f7a9d17
Ensure we load OSProcess and not OSSubprocess
ThierryGoubier Feb 28, 2018
02b8f45
DNU caused by IceMCVersionInfo
ThierryGoubier Mar 1, 2018
edd663d
- Mistake in handling special files
ThierryGoubier Mar 1, 2018
85ff4d2
Add a reasonable try for OSSubprocess / fast-import
ThierryGoubier Mar 1, 2018
32eba92
Progress on fast-import byte array building
ThierryGoubier Mar 1, 2018
1c2591a
Improvements
ThierryGoubier Mar 2, 2018
3310e54
Saving a broken version for now
ThierryGoubier Mar 2, 2018
67d3b4a
Ensure a git commit when we write properties in that test.
ThierryGoubier Mar 2, 2018
42c9248
Revert a change in accessing repository properties.
ThierryGoubier Mar 2, 2018
d76076c
Ensure that we properly commit properties into the repo if we do it o…
ThierryGoubier Mar 3, 2018
bcdcd6a
Solved a hidden infinite recursion in MCFileTree on repository proper…
ThierryGoubier Mar 3, 2018
3e3da9e
Added a pharo6.1 and Pharo6.1 64bits target
ThierryGoubier Mar 3, 2018
e53f03e
Removing that onError: aBlock addition -- the bug was the infinite re…
ThierryGoubier Mar 3, 2018
c025c19
Cosmetic changes
ThierryGoubier Mar 3, 2018
ae26cd1
Wrongly recreated properties there
ThierryGoubier Mar 3, 2018
fb3df66
Using STON instead of writing json by hand. from / no from if first c…
ThierryGoubier Mar 3, 2018
16ee173
Forgot I was tracking fast-import command files
ThierryGoubier Mar 3, 2018
086b003
Change slightly the way issue 146 is tested.
ThierryGoubier Mar 3, 2018
247cf58
Nearly sure the issue146 failure is an artefact of the CI process aga…
ThierryGoubier Mar 3, 2018
8a8a655
ThierryGoubier Mar 3, 2018
773a44e
Cleaning up file accesses
ThierryGoubier Mar 3, 2018
46e5939
Update the scan for method versions in a git repository.
ThierryGoubier Mar 3, 2018
b0f4a2a
maxVersionWithAncestors may be nil
ThierryGoubier Mar 4, 2018
0a638f5
MCCacheRepository uniqueInstance it is, not default
ThierryGoubier Mar 4, 2018
1841345
Add the logic so that the fast-import command works with OSSubprocess.
ThierryGoubier Mar 10, 2018
d324da2
Update the baseline
ThierryGoubier Mar 8, 2018
0aaaf0c
Changes:
ThierryGoubier Mar 11, 2018
afb6bf8
Simply the git command default directory.
ThierryGoubier Mar 11, 2018
4c5cf12
Revert the unixLineEndings (not necessary)
ThierryGoubier Mar 11, 2018
00719c7
Superb endless loop with gitTopDirectory
ThierryGoubier Mar 11, 2018
3c14992
Change empty / utf8 end of commit message tests
ThierryGoubier Mar 11, 2018
18908c2
Silly bug
ThierryGoubier Mar 11, 2018
f0b5e4f
Change tests for commit messages without additional characters
ThierryGoubier Mar 11, 2018
7be1bcb
Ensure we don't add an additional character at the end of commit mess…
ThierryGoubier Mar 11, 2018
596e071
Introduce UTF8 characters into the monticello.meta/version file: Lit…
ThierryGoubier Mar 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .filetree

This file was deleted.

3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ os:

# Select compatible Smalltalk image(s)
smalltalk:
- Pharo-6.0
- Pharo-6.1
- Pharo64-6.1
5 changes: 3 additions & 2 deletions repository/BaselineOfFileTree.package/.filetree
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"noMethodMetaData" : true,
"separateMethodMetaAndSource" : false,
"useCypressPropertiesFile" : true }
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ baseline: spec
spec
for: #common
do: [ spec
configuration: 'OSSubprocess'
configuration: 'OSProcess'
with: [ spec
versionString: #stable;
repository: 'github://marianopeck/OSSubprocess/repository' ];
repository: 'http://www.squeaksource.com/MetacelloRepository' ];
yourself.
spec
configuration: 'ProcessWrapper'
Expand All @@ -32,17 +32,17 @@ baseline: spec
for: #Unix
do: [ spec
package: 'MonticelloFileTree-Git'
with: [ spec requires: #('MonticelloFileTree-Core' ) ] ].
with: [ spec requires: #('MonticelloFileTree-Core') ] ].
spec
for: #MacOSSubprocess
for: #MacOSProcess
do: [ spec
package: 'MonticelloFileTree-Git'
with: [ spec requires: #('MonticelloFileTree-Core' 'OSSubprocess') ] ].
with: [ spec requires: #('MonticelloFileTree-Core' 'OSProcess') ] ].
spec
for: #UnixOSSubprocess
for: #UnixOSProcess
do: [ spec
package: 'MonticelloFileTree-Git'
with: [ spec requires: #('MonticelloFileTree-Core' 'OSSubprocess') ] ].
with: [ spec requires: #('MonticelloFileTree-Core' 'OSProcess') ] ].
spec
for: #Windows
do: [ spec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
accessing
customProjectAttributes
Smalltalk os isMacOS
ifTrue: [ (Smalltalk at: #PipeableOSProcess ifAbsent: [ ])
ifNil: [ (Smalltalk at: #OSSUnixSubprocess ifAbsent: [ ])
ifNil: [ ^ #(#MacOSSubprocess) ]
ifNotNil: [ ^ #(#MacOS) ] ]
ifNotNil: [ ^ #(#MacOS) ] ].
ifTrue: [ (Smalltalk hasClassNamed: #PipeableOSProcess)
ifFalse: [ (Smalltalk hasClassNamed: #OSSUnixSubprocess)
ifFalse: [ ^ #(#MacOSProcess) ]
ifTrue: [ ^ #(#MacOS) ] ]
ifTrue: [ ^ #(#MacOS) ] ].
Smalltalk os isUnix
ifTrue: [ ^ (Smalltalk at: #PipeableOSProcess ifAbsent: [ ])
ifNil: [ (Smalltalk at: #OSSUnixSubprocess ifAbsent: [ ])
ifNil: [ ^ #(#UnixOSSubprocess) ]
ifNotNil: [ ^ #(#Unix) ] ]
ifNotNil: [ ^ #(#Unix) ] ].
ifTrue: [ (Smalltalk hasClassNamed: #PipeableOSProcess)
ifFalse: [ (Smalltalk hasClassNamed: #OSSUnixSubprocess)
ifFalse: [ ^ #(#UnixOSProcess) ]
ifTrue: [ ^ #(#Unix) ] ]
ifTrue: [ ^ #(#Unix) ] ].
Smalltalk os isWindows
ifTrue: [ ^ #(#Windows) ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"class" : {
},
"instance" : {
"baseline:" : "ThierryGoubier 4/30/2016 16:03",
"customProjectAttributes" : "ThierryGoubier 4/30/2016 16:02" } }
"baseline:" : "ThierryGoubier 3/8/2018 22:55",
"customProjectAttributes" : "ThierryGoubier 3/8/2018 22:54"
},
"class" : { }
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"category" : "BaselineOfFileTree",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "BaselineOfFileTree",
"pools" : [
],
"super" : "BaselineOf",
"type" : "normal" }
"category" : "BaselineOfFileTree",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BaselineOfFileTree",
"type" : "normal"
}
34 changes: 2 additions & 32 deletions repository/BaselineOfFileTree.package/monticello.meta/version
Original file line number Diff line number Diff line change
@@ -1,32 +1,2 @@
(name 'BaselineOfFileTree-ThierryGoubier.32' message '#Unix, #MacOS !' id 'ff6fcae4-dce4-452c-9905-56da70d23abe' date '30 April 2016' time '4:03:40.734218 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.31' message 'Check for OSSubprocess as well.
' id '17accafe-b515-508c-b488-6af5104cd30f' date '30 April 2016' time '3:59:20 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.30' message 'Target both OSProcess and OSSubprocess ?
' id '4416e1d2-e43c-59e3-b9c5-a58ab958e8c4' date '30 April 2016' time '12:00:13 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.29' message 'updating the issue_171 branch with current pharo5.0_dev
' id '6eab405a-8020-5ee1-84fb-3e30789fce7a' date '29 March 2016' time '10:52:56 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-MarianoMartinezPeck.26' message 'Fix issue #175 for branch issue_171
' id 'a9aaf494-26c9-5c62-9fa5-f9670bb99297' date '6 February 2016' time '9:55:10 am' author 'MarianoMartinezPeck' ancestors ((name 'BaselineOfFileTree-MarianoMartinezPeck.25' message 'Fix issue #175 for branch issue_171
' id '66373e5b-f482-5868-813a-2d02ab411f8b' date '6 February 2016' time '9:51:12 am' author 'MarianoMartinezPeck' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.22' message 'Forgot to update the requires!
' id '0cfdc14c-d709-5603-a7b2-c37423182a2d' date '14 January 2016' time '10:25:39 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.21' message 'Replace OSProcess by OSSubprocess
' id '8abebac6-afa8-5f07-8929-c59bb8b88de8' date '14 January 2016' time '9:58:25 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.19' message 'Reactivate GitFileTree tests
' id '40621310-ff38-5ecf-8759-e713bea8374a' date '23 July 2015' time '4:06:59 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.18' message 'Remove the git tests for now
' id '80b5f97d-c674-525a-9b97-e9a3d2198572' date '23 July 2015' time '10:26:18 am' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.17' message 'Activated Git Tests in the travis CI
' id 'ad10178e-3197-5bcd-b6d4-903eb8dbe314' date '23 July 2015' time '9:42:49 am' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.16' message 'Wrong Repository for OSProcess
' id '888fb307-4ff0-51b7-b951-06e11128f873' date '6 March 2015' time '9:47:37 am' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.15' message 'Switch to the OSProcess configuration in MetaRepoForPharo30
' id 'eac20fe8-4aa9-5ab4-b0a3-4527ee3b05ea' date '6 March 2015' time '7:22 am' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.14' message 'Added support for loading ProcessWrapper (Windows Support)
' id 'e85ac281-20e9-5b65-91cf-a9c5720c4163' date '2 March 2015' time '7:24:56 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.13' message 'bump baseline monticello version
' id '3aa08233-a131-5c97-ba2a-d9304c19ca02' date '1 September 2013' time '10:21:10 pm' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.12' message 'have to remove MonticelloFileTree-GitTests from Tests ... create separate Git Tests group
' id '42e9ad70-c7b6-5f7d-b48c-d90e0a0db082' date '1 September 2013' time '9:00:20 am' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.11' message 'remove Git load/testing for pharo3.0, per Thierry''s comment[1]
' id '2c7be37b-ff03-537a-b89a-3c505d29df2e' date '1 September 2013' time '8:48:26 am' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.10' message 'cherry-pick: fd9d9be3be16c5ea001c41d6ad93fa49de055dc3 (gitrepo work from Thierry)
' id '5579aadb-16eb-5458-962c-d887f5cd0363' date '28 June 2013' time '1:42:37 pm' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.9' message 'create Git group for MonticelloFileTree-Git package
' id '15e20e3f-1f81-56b2-96b2-c816299b6642' date '15 June 2013' time '6:06:05 pm' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.8' message 'add MonticelloFileTree-Git to baseline
' id '92698551-d187-5bf9-a3fc-deffe6788e0e' date '3 June 2013' time '2:46:21 pm' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.7' message 'Merge branch ''master'' into pharo2.0: all tests green in Pharo-2.0a-20305
' id '830a45dc-ffc4-5ab1-9d2e-c0b87ff60459' date '24 September 2012' time '5:14:05 pm' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.5' message 'Issue #52: update baseline for pharo-2.0
' id 'bab12d8f-8e2e-5361-bc3b-1e00a85ffbe7' date '10 August 2012' time '10:26:57 pm' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.4' message 'Issue #52: fix the baseline
' id 'a9c223a6-447a-59bd-814a-bbd5dc4e4c5d' date '10 August 2012' time '7:03:57 pm' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.3' message 'Issue #52: add new packages to baseline
' id '7592aa14-1183-5c48-a3e9-f9b2e54d30f3' date '10 August 2012' time '5:13:02 pm' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.2' message 'Merge branch ''issue_38'' into pharo1.3: Issue #38 fix (cherry picked from commit 4065e9230164df95dd013cfaa2f58e89803ab391)
' id '0777e8f9-d874-5f1f-bc68-c74bacc2fa1a' date '5 July 2012' time '11:24:40 am' author 'DaleHenrichs' ancestors ((name 'BaselineOfFileTree-DaleHenrichs.1' message '[travis-ci and BaselineOf] cherry pick line of commits from: 7ca09f5ac0d182d4b940403936fb11303a544db1 to 6e01c7dd719e9e742c2730e05bb89b995d36a0d0
' id '5b3ff9c7-b547-5367-82ab-d012de13a941' date '11 June 2012' time '2:58:16 pm' author 'DaleHenrichs' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())(name 'BaselineOfFileTree-DaleHenrichs.6' message 'Merge branch ''issue_52'' into pharo1.4: Issue #52
' id '82a62164-f27e-5fff-9934-ce5e16ac1a16' date '10 August 2012' time '10:34:37 pm' author 'DaleHenrichs' ancestors ((id '0777e8f9-d874-5f1f-bc68-c74bacc2fa1a')) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())(name 'BaselineOfFileTree-ThierryGoubier.28' message 'Revert to Mariano changes
' id '20c442c5-bd0b-5a8b-9df5-394152d17cbd' date '27 March 2016' time '6:50:12 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.27' message 'Merge Otto Behrens improvements on the Pharo5.0_dev branch
' id '6897578a-5a26-52b0-9121-ca6aa92c62e2' date '27 March 2016' time '6:47:07 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-MarianoMartinezPeck.24' message 'Fix to issue #175. This one should work
' id 'b2eed698-eab4-510e-9d00-cb3e45f680e8' date '5 February 2016' time '10:51:38 am' author 'MarianoMartinezPeck' ancestors ((name 'BaselineOfFileTree-MarianoMartinezPeck.23' message 'Trying to fix issue #175 but not luck
' id '64f2a773-f8b8-5b6b-aabd-eeeb16a62ad4' date '31 January 2016' time '10:02:56 pm' author 'MarianoMartinezPeck' ancestors ((id '40621310-ff38-5ecf-8759-e713bea8374a')) stepChildren ())) stepChildren ())(name 'BaselineOfFileTree-ThierryGoubier.20' message 'This is maintained for Pharo 4
' id '51bc40d6-854c-5060-ab9a-0d5b3f168259' date '17 November 2015' time '6:58:54 am' author 'ThierryGoubier' ancestors ((id '40621310-ff38-5ecf-8759-e713bea8374a')) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
(name 'BaselineOfFileTree-ThierryGoubier.1520015085' message 'Update the baseline' id '95957f79-4f23-0d00-88b7-a36c0faff969' date '8 March 2018' time '10:55:45.03195 pm' author 'ThierryGoubier' ancestors ((name 'BaselineOfFileTree-ThierryGoubier.1520015084' message 'Revert a change in accessing repository properties.
' id '57efc516-a8a9-554f-8627-9b0b12407b2b' date '2 March 2018' time '7:24:44 pm' author 'ThierryGoubier' ancestors () stepChildren ())) stepChildren ())
3 changes: 1 addition & 2 deletions repository/BaselineOfFileTree.package/properties.json
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{
}
{ }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
I represent an object entry in git store, along the format provided by git ls-tree.

I can be used to query a store files and directories instead of querying the working tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
from: aLineAsString
"Extracted from a line provided by git ls-tree"

^ self new from: aLineAsString
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
fromAll: aString
"Extracted from a string containing the lines of git ls-tree"

^ aString lines collect: [ :aLine | self from: aLine ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
file
^ file
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
initialize-release
from: aLineAsString
"<mode> SP <type> SP <object> TAB <file>"

(Character tab split: aLineAsString)
in: [ :anArray |
(Character space split: anArray first)
in: [ :anInsideArray |
mode := anInsideArray first.
type := anInsideArray second.
object := anInsideArray third ].
file := anArray second ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isDirectory
^ type = 'tree'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mode
^ mode
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
name
^ file
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
object
^ object
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
type
^ type
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"instance" : {
"type" : "ThierryGoubier 3/2/2018 09:51",
"isDirectory" : "ThierryGoubier 3/2/2018 10:22",
"mode" : "ThierryGoubier 3/2/2018 09:51",
"object" : "ThierryGoubier 3/2/2018 09:51",
"name" : "ThierryGoubier 3/2/2018 10:17",
"file" : "ThierryGoubier 3/2/2018 09:51",
"from:" : "ThierryGoubier 3/2/2018 09:57"
},
"class" : {
"fromAll:" : "ThierryGoubier 3/2/2018 10:13",
"from:" : "ThierryGoubier 3/2/2018 09:57"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"commentStamp" : "<historical>",
"super" : "MCFileTreeWriter",
"super" : "Object",
"category" : "MonticelloFileTree-Git",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "MCFileTreeGitWriter",
"instvars" : [
"mode",
"type",
"object",
"file"
],
"name" : "GitFileTreeObjectEntry",
"type" : "normal"
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,26 @@ MCRepository basicFromUrl: 'gitfiletree://github.com/dalehenrich/filetree:pharo5
gitfiletree core documentation :

gitfiletree maps MC commands onto git commands via OSProcess, and MC metadata out of git commit data. That's all there is to it. A bit of git knowledge can help, but no git command line work is necessary. The inner workings are a bit more complex than that of course, but not by much.

gitfiletree new attempt :

When reading, gitfiletree does not use the working tree. When writing with fast-import, gitfiletree does not use the working tree either. Using bare git repositories could then work nicely, wthout any possible mess of a working tree. It would work, except for the fact that the working tree is necessary for some commands (merge, pull). However, gitfiletree would get the benefit of never using the working tree (and hence have issues with file names and the like)

- Clone:
git clone --bare
git clone --mirror
- Change branch
git symbolic-ref HEAD refs/heads/pharo6
- Ok on bare:
git log <branchName>
git branch -> git update-ref refs/heads/new_branch refs/heads/master
git need to pull
- Not Ok on bare
git pull -> replaced by git fetch plus a git merge ?
git push -> has to be explicit? git push origin <branchName> "works very nicely"
git rev-parse --show-toplevel -> doesn't work, not needed.
git versions for package -> need object navigation
- Object navigation
git cat-file -p <hash> -> various objects starting with a commit (can do git cat-file -p <branch>)
git ls-tree <branch>:<path> -> show all entries. can recurse (-r)
git rev-parse --is-inside-work-tree -> answers false (not in a work tree)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
accessing
runGitCommand: anArrayOfStrings in: aDirectory withInput: aString
"Dispatch depending on the platform."

UIManager default
informUserDuring: [ :bar |
bar label: self gitCommand , ' ' , anArrayOfStrings first.
Smalltalk platform isWin32
ifTrue: [ ^ self
runProcessWrapperGitCommand: anArrayOfStrings
in: aDirectory
withInput: aString ]
ifFalse: [ ((Smalltalk at: #OSSUnixSubprocess ifAbsent: [ ])
ifNil: [ false ]
ifNotNil: [ :g | g isClass ])
ifTrue: [ ^ self
runOSSubprocessGitCommand: anArrayOfStrings
in: aDirectory
withInput: aString ]
ifFalse: [ ^ self
runOSProcessGitCommand: anArrayOfStrings
in: aDirectory
withInput: aString ] ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
private-commands
runOSProcessGitCommand: anArrayOfStrings in: aDirectory withInput: aByteArray
"Run a git command, no shell, with a full path and arguments in an array. Add the input encoded in utf8 as stdin."

| classOfExternalPipe classOfPipeableOSProcess c r d in out err file |
classOfExternalPipe := Smalltalk at: #ExternalPipe.
classOfPipeableOSProcess := Smalltalk at: #PipeableOSProcess.
(file := FileReference newTempFilePrefix: 'GitCommand' suffix: '.txt')
writeStreamDo: [ :s |
s binary.
s nextPutAll: aByteArray ].
in := FileStream readOnlyFileNamed: file pathString.
out := classOfExternalPipe nonBlockingPipe.
err := classOfExternalPipe nonBlockingPipe.
[ c := classOfPipeableOSProcess externalProxyClass
programName: self gitCommand
arguments: anArrayOfStrings
initialEnvironment: nil.
c initialStdIn: in.
c initialStdOut: out writer.
c initialStdErr: err writer.
c pwd: (MCFileTreeFileUtils current directoryPathString: aDirectory).
c := c initialize value.
d := nil.
in close.
r := out upToEnd.
[ c update: #runState.
c isComplete ]
whileFalse: [ (d ifNil: [ d := Delay forMilliseconds: 5 ]) wait.
r := r , out upToEnd ].
r := r , out upToEndOfFile.
c succeeded
ifFalse: [ | errorString |
errorString := err upToEndOfFile.
errorString notEmpty
ifTrue: [ MCFileTreeGitError new signal: 'Git error: ' , errorString ].
r := '' ] ]
ensure: [ in close.
out close.
err close.
file ensureDelete ].
^ r
Loading