Hi,
since I am slowly switching all my repositories to metadata-less, it would
be cool if there was some GUI for it.
The best place would be when right clicking on the repository in the
monticello browser, unfortunately that menu is hardcoded.
An alternative is to add another button the repository detail, i.e.:
MCFileTreeGitRepositoryInspector>>buttonSpecs
repository readonly
ifTrue: [ ^ super buttonSpecs ]
ifFalse: [ ^ #(#('Pull' gitPull 'git pull and refresh') #('Push' gitPush
'git push' gitNeedPush))
, super buttonSpecs
,
(repository hasMetadata
ifTrue: [ #(#('Remove Metadata' removeMetadata 'switch to metadata-less
mode')) ]
ifFalse: [ #() ]) ]
MCFileTreeGitRepositoryInspector>>removeMetadata
"Switch the repository to a metadata-less mode"
| properties |
properties := STON fromString: repository directory / '.filetree'.
properties at: 'Metadata' put: 'false'.
(repository directory / '.filetree')
ensureDelete;
writeStreamDo: [ :stream | stream nextPutAll: (STON toJsonStringPretty:
properties) ].
repository gitCommand: #('commit' '-m' 'Switched repository to
metadata-less mode.' '--' '.filetree') in: repository directory.
repository flushCache.
self refresh
Not the prettiest, but it seems to work.
Btw I've written a short post for this
https://www.peteruhnak.com/blog/2016/08/05/switch-to-metadata-less-gitfiletree/
Peter