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

Guillermo Polito guillermopolito at gmail.com
Thu Jun 28 04:36:24 EDT 2018


> You mentioned a Calypso plugin for versions - where is that? I loaded a
recentish P7 image and I don’t see those icons? Is this something I can
easily load to try out?

As soon as a class is inside a package that is managed by iceberg, you
should see in Calypso a new button and menu item on methods (called
History, with a little box icon).

> Not sure how to get a repository but I cobbled together the following?

> (IceLibgitRepository registry detect: [ :r | r name beginsWith: 'Prismic'
]) lookupCommit: '65363ad’.

> This give me an IceGitCommit - but then what can I easily do with this to
try and iterate over deleted classes to try and get the one I’ve identified
back?

Well there is no magic :). Either you walk the commits (#parent or
#newCommitWalk (!! too low level)) and calculate for each a diff against
its parent (#diffTo:).
Other thing you can do to check how IceGitLog is implemented, using
directly libgit.

About the git error, I don't have time to check now but, I think it may be
something easy that is going under your nose :)
You got your commitish from the `git log --diff-filter=D --summary
—pretty="format:%cd|%h|%cn%n%s%n”`, didn't you?
Then, this means the commitish you got has the file already deleted! So if
you want to recover it, you have to check its parent!

Can you try (notice the added the ~1)

$ git checkout 65363ad~1 src/PrismicDemo/PrismicBlock.class.st

?

On Thu, Jun 28, 2018 at 2:32 AM Tim Mackinnon <tim at testit.works> wrote:

> For the record - I get the same error using those steps on Ubuntu as well.
> So I must be doing something wrong?
>
> (Note in my message when I pasted the command used - I neglected the git
> in front of: log --diff-filter=D --summary —pretty="format:%cd | %h | %H
> | %cn%n-> %s%n”)
>
>
>
> Tim
>
> On 28 Jun 2018, at 00:46, Tim Mackinnon <tim at testit.works> wrote:
>
> And just to add to this - I just did a git clone (git clone git at github.com
> :pharo-project/pharo.git)  in a fresh directory and can see that same
> deleted file - and when I try to do a checkout, it gives the path spec
> error.
>
> This is very weird - is it some osx thing? I will try it on ubuntu - but I
> feel I must be missing something, like do I need a different prefix on path
> names (but you didn’t seem to need one)?
>
> I’d be very worried if git is acting up… but I still suspect user error
> here.
>
> Tim
>
>
> On 28 Jun 2018, at 00:38, Tim Mackinnon <tim at testit.works> wrote:
>
> Hey thanks Ben - this still doesn’t work for me… good idea to try on the
> Pharo repo itself.
>
> I have a fork of it, which I catch up periodically - so I tried a similar
> suggestion to you - went into my directory (underneath the src folder) and
> typed:
>
> log --diff-filter=D --summary --graph --pretty='format:%cd | %h | %H |
> %cn%n-> %s%n’
>
> This gave me:
>
> Tue Jun 19 19:28:37 2018 +0200 | 13e81343e |
> 13e81343e8a23a8d6ca43f1c77b804b8134fc986 | CyrilFerlicot
> -> Remove now useless logs
>
>  delete mode 100755 bootstrap/scripts/printFolderContent.sh
>
> Mon Jun 18 16:50:19 2018 +0200 | 0433d908d |
> 0433d908de2987fa0069a47dee1f0794ccbb52c2 | GitHub
> -> Revert "22161-Add-more-log-to-bootstrap"
>
>  delete mode 100755 bootstrap/scripts/printFolderContent.sh
>
> Thu Jun 14 11:41:16 2018 +0200 | b4a285a61 |
> b4a285a61d3eb0cc1e642b2fcc242dac7092617f | Marcus Denker
> -> fix the last sender of #asIcon
> https://pharo.fogbugz.com/f/cases/22139/fix-the-last-sender-of-asIcon
>
>  delete mode 100644 src/Polymorph-Widgets-Rules/IconShortcutRule.class.st
> <http://iconshortcutrule.class.st/>
>
> So then I tried to recover that last one (again at root underneath the src
> directory)
>
> git checkout b4a285a61 src/Polymorph-Widgets-Rules/
> IconShortcutRule.class.st <http://iconshortcutrule.class.st/>
> error: pathspec 'src/Polymorph-Widgets-Rules/IconShortcutRule.class.st
> <http://iconshortcutrule.class.st/>' did not match any file(s) known to
> git.
>
> And I still get that dreaded pathspec error. This is on OSX (not windows)
> - so I’m struggling to understand what I could be doing wrong. It must be
> something obvious - but damned if I can see how I’m doing anything
> different to you. And it wouldn’t make sense that git is broken on OSX?
>
> Tim
>
> On 25 Jun 2018, at 14:21, Ben Coman <btc at openInWorld.com> wrote:
>
> On 25 June 2018 at 19:41, Tim Mackinnon <tim at testit.works> wrote:
>
>> I’d be really interested if someone with lower level GIT knowledge might
>> try a:
>>
>> git checkout <gitid> src/<proj>/<class>.class.st
>> <http://prismicblock.class.st/>
>>
>> For their project - as I don’t understand what I’m doing wrong - and I’d
>> like the comfort of knowing that our source is in a place/state where we
>> can rely on normal git tools in a case of emergency. At the moment, I’m a
>> bit nervous that we are corrupting something .
>>
>> Tim
>>
>
> I'm not sure if this is what you wanted, but I found a test case for for
> Pharo 7, a deleted class "MultiByteFileStreamTest.class.st
> <http://multibytefilestreamtest.class.st/>"
>
> https://github.com/pharo-project/pharo/pull/1031/files#diff-750a25fb99d29cda8c2c388dc18f6c1cL1
>
> From Windows 10 cmd.exe I tried the following (I can't remember which
> tool installed `git`)...
>
> > mkdir C:\temp\test
> > cd C:\temp\test
> > git clone git at github.com:pharo-project/pharo.git
> > cd pharo\src\Deprecated70
> > dir  Multi*
> no result
> > git checkout e74308e67d9f84 MultiByteFileStreamTest.class.st
> <http://multibytefilestreamtest.class.st/>
> > dir Multi*
> MultiByteFileStreamTest.class.st
> <http://multibytefilestreamtest.class.st/>
>
> Then I compared the file I checked out to the raw file on github and they
> were identical...
> https://www.diffchecker.com/gVCpJzFe
>
>
> btw, I did get a momentary error "error: pathspec 'src/Deprecated70/
> MultiByteFileStreamTest.class.st
> <http://multibytefilestreamtest.class.st/>' did not match any file(s)
> known to git."
> when I incorrectly did...
> > cd pharo\src\Deprecated70
> > git  git checkout e74308e67d9f84  src/Deprecated70/
> MultiByteFileStreamTest.class.st
> <http://multibytefilestreamtest.class.st/>
>
>
> This worked with the longer path...
> > cd pharo
> > git  git checkout e74308e67d9f84  src/Deprecated70/
> MultiByteFileStreamTest.class.st
> <http://multibytefilestreamtest.class.st/>
>
> cheers -ben
>
>
>
>
>

-- 



Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - *http://www.cnrs.fr
<http://www.cnrs.fr>*


*Web:* *http://guillep.github.io* <http://guillep.github.io>

*Phone: *+33 06 52 70 66 13
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20180628/a57bdcac/attachment-0001.html>


More information about the Pharo-users mailing list