[Pharo-users] Iceberg working with forks - can it be easier?

Guillermo Polito guillermopolito at gmail.com
Mon Feb 18 04:04:16 EST 2019


On Mon, Feb 18, 2019 at 1:19 AM Tim Mackinnon <tim at testit.works> wrote:

> Hey Ben - I’m not sure that this actually does the same thing. I just
> tried it now, and it resulted in an extra merge in my forked repo - as I
> think this effectively pulls down from upstream into pharo and then if you
> have any differences in your local image copy they might cause some changes
> which then you would push back into your fork origin.
>
> If you just want a verbatim copy in your fork - you have to resort the
> command line?
>

Ah! well merging may do two things:

 - create a merge commit (in case of diverging history)
 - do a fast forward (just update your branch)

The thing is that you want to **undo** your changes before merging,
otherwise you'll have a dangling commit there that you did not want :).
You cannot do that from Iceberg's UI right now, you can do it from any
expression evaluator:

"Rough equivalent of reset --hard HEAD~1"
repository branch commit: repository branch commit parent.

But even then, Iceberg does not (yet) implement push --force, because we
never found a useful use case (other than bad practices) to it.

This is important: if you have made changes to your repository, then
"making a verbatim copy" means to undo your changes.
Even from the command line, what you may want to do is: move to another
branch, remove your "to-sync" branch, fetch from origin, checkout
origin/"to-sync", push force to your fork. But you may lose your changes...


> I’m still mulling this over - as would you then pull from your upstream
> fork and still get the same differences that you would then apply? I’m not
> sure now - but if the idea was just to get yourself back into a consistent
> state - Its not clear to me how you can get all 3 copies saying the same
> thing in pharo?
>
> Tim
>
> On 16 Feb 2019, at 06:19, Ben Coman <btc at openInWorld.com> wrote:
>
>
>
> On Sat, 16 Feb 2019 at 02:06, Tim Mackinnon <tim at testit.works> wrote:
>
>> Hi guys - I’ve spent a few hours scratching my head trying to understand
>> why some of my Pull Requests to a project I had forked kept showing my
>> previous commits when I thought I was all caught up.
>>
>> It suddenly dawned on me, that when I had forked, and then done some work
>> and then submitted a PR, and then applied it upstream that my fork is now
>> no longer in sync with its upstream counterpart.
>>
>> Having not done this in ages, it took me a while to then realise I have
>> to do some git stuff to get it back in sync e.g. (and I think I’ve got this
>> right)
>>
>> git fetch upstream (or whatever name you gave it)
>> Git checkout master
>> Git merge upstream/master
>>
>> So I guess my question is - wouldn’t it be helpful if this was a command
>> in Iceberg? It seems quite common to fork a project (I think this is still
>> recommended for pharo itself isn’t it?) - and then at some point you need
>> to catchup with that origin again? Or am I missing something? I guess lots
>> of stuff can go wrong - but if it does - you’d still get the same problems
>> on the command line. It just seems that for normal situations - it would be
>> handy to run this straight in Pharo.
>>
>
> I'm not fully-conversant with Iceberg, but if I guess right...
> in Iceberg, right-click a repo and open its "Repository" window.
> In the top-right click the "Add remote" button, to add the upstream repo.
> That button is a bit hidden there.  It might be nice to have it as a menu
> item on "Remotes" in the first pane.
> Then click the <Merge> button, then select the upstream master branch and
> you should be up to date.
>
> 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/20190218/04b1d9b6/attachment.html>


More information about the Pharo-users mailing list