[Pharo-users] Iceberg - finding deleted classes, reverting versions?

Tim Mackinnon tim at testit.works
Wed Jun 13 13:49:47 EDT 2018

Hi Sean - that is an excellent reply, I didn’t quite get your fu to work - but if you look up how to find deleted classes in git they give the following:

git log --diff-filter=D --summary

This gives you a git list of checkins and shows you the checkin comment, along with the list of files that were deleted (this is using tonel format, so its quite clear).

A bit more man help gives a better:

git log --diff-filter=D --summary --pretty='format:%cd|%h|%cn%n%s%n’

Which will output something a bit more like what I think you have to use to then understand how to find your change (the %h is the short hash with the Repository explorer in the new Iceberg shows). So you then get something like this:

Mon Jun 11 01:33:59 2018 +0100|65363ad|Tim Mackinnon
Refactor to a more consistent design with support for a basic link resolver

 delete mode 100644 src/PrismicDemo/PrismicBlock.class.st
 delete mode 100644 src/PrismicDemo/PrismicSpan.class.st
 delete mode 100644 src/PrismicDemo/PrismicSpannedText.class.st
 delete mode 100644 src/PrismicDemo/PrismicTextSpan.class.st

Wed Jun 6 19:05:07 2018 +0100|4bea74d|macta
Better handling of more data types for improved demo

 delete mode 100644 src/PrismicDemo/Text.extension.st

This does highlight a few more thing though (and possibly future things to implement) - there is no search in the Repository list, so you have to scroll down yourself.

Having found the class of interest - if I want to restore it, you are a bit on your own here too, as I think the “Revert Change” menu option (regardless of where you click) is going to try and recover the whole checkin and not let you cherry pick the class you want. You can of course at least see the source in the middle pane, and copy paste each method (but it could be a bit tedious).

Possibly you might then be able to do this:

git checkout 65363ad src/PrismicDemo/PrismicBlock.class.st

I’m not sure how Pharo will then react to this command line jiggery - as I keep getting an error : error: pathspec 'PrismicDemo/PrismicBlock.class.st' did not match any file(s) known to git.

But I suspect its something like that?


> On 13 Jun 2018, at 17:23, Sean P. DeNigris <sean at clipperadams.com> wrote:
> Tim Mackinnon wrote
>> Hi - I am interested in what the future holds with Iceberg for things like
>> finding deleted classes or reverting to older versions of things.
> Great question! It used to be in the Change Sorter that delections were
> logged and reversible. At some point that stopped working and then I moved
> to git so I don't know if it was ever fixed. Obviously, that only looks back
> w/in the current image which doesn't fully solve your issue. The cool thing
> about git is that we inherit all its functionality - the good and bad. So
> iot got me wondering whether we could drop down to the command line for the
> time being. After some googling and experimentation, I came up with the
> following:
>    git log --full-history -- */{{className}}.class/properties.json
> NB. I had to add the properties.json because directories don't work, but
> that may not be needed with Tonel
> -----
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20180613/e916d2f1/attachment-0001.html>

More information about the Pharo-users mailing list