pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Is there an easy way to cherry pick methods from another branch in iceberg?

TM
Tim Mackinnon
Mon, Jun 21, 2021 11:39 PM

Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work.

A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?)

The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head?

Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes")

Tim

Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work. A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?) The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head? Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes") Tim
TM
Tim Mackinnon
Sat, Jun 26, 2021 6:18 PM

Just nudging this one - as I’d like to improve my Iceberg foo - and cherry picking methods and reverting are things I’d like to learn how to do better?

On 22 Jun 2021, at 00:39, Tim Mackinnon tim@testit.works wrote:

Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work.

A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?)

The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head?

Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes")

Tim

Just nudging this one - as I’d like to improve my Iceberg foo - and cherry picking methods and reverting are things I’d like to learn how to do better? > On 22 Jun 2021, at 00:39, Tim Mackinnon <tim@testit.works> wrote: > > Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work. > > A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?) > > The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head? > > Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes") > > Tim
CM
Clint Moore
Sun, Jun 27, 2021 1:17 AM

+1 person who would like to know this so I don't have to do it from a terminal.

On Sat, Jun 26, 2021 at 11:18 AM Tim Mackinnon tim@testit.works wrote:

Just nudging this one - as I’d like to improve my Iceberg foo - and cherry picking methods and reverting are things I’d like to learn how to do better?

On 22 Jun 2021, at 00:39, Tim Mackinnon tim@testit.works wrote:

Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work.

A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?)

The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head?

Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes")

Tim

+1 person who would like to know this so I don't have to do it from a terminal. On Sat, Jun 26, 2021 at 11:18 AM Tim Mackinnon <tim@testit.works> wrote: > > Just nudging this one - as I’d like to improve my Iceberg foo - and cherry picking methods and reverting are things I’d like to learn how to do better? > > > On 22 Jun 2021, at 00:39, Tim Mackinnon <tim@testit.works> wrote: > > > > Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work. > > > > A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?) > > > > The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head? > > > > Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes") > > > > Tim
GP
Guillermo Polito
Mon, Jun 28, 2021 12:12 PM

Hi Tim,

El 22 jun 2021, a las 1:39, Tim Mackinnon tim@testit.works escribió:

Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work.

A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?)

This seems to be a feature that was not migrated in the iceberg-to-spec2 migration.
Would you mind opening an issue?

The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head?

There are two different questions in here.

  • How can you go back to some older commit?

In iceberg this is done by creating a new branch from the commit you’re interested in. The “Branch…” menu will open a pop-up to allow you creating a new branch from that point in time.
Then you can checkout that branch and work as with any other branch.

  • How can you undo some history (that was even pushed)?

Iceberg does not support this scenario yet, as it could be very problematic when working in teams.
Undoing some history / removing some commit will produce undesired effects on people that had pulled that commit.
This is one of the scenarios that in git requires a —force flag.

If you want to do such a thing, you need for now to do it from the command line

$ git reset —hard THE_COMMIT_ID_YOU_WANT_TO_GO_BACK_TO
$ git push -f

And then checkout the branch back from iceberg (which will show a detached working copy — see https://books.pharo.org/booklet-ManageCode/pdf/2020-05-12-ManageCode.pdf).

G

Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes")

Tim

Hi Tim, > El 22 jun 2021, a las 1:39, Tim Mackinnon <tim@testit.works> escribió: > > Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work. > > A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?) This seems to be a feature that was not migrated in the iceberg-to-spec2 migration. Would you mind opening an issue? > > The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head? There are two different questions in here. - How can you go back to some older commit? In iceberg this is done by creating a new branch from the commit you’re interested in. The “Branch…” menu will open a pop-up to allow you creating a new branch from that point in time. Then you can checkout that branch and work as with any other branch. - How can you undo some history (that was even pushed)? Iceberg does not support this scenario yet, as it could be very problematic when working in teams. Undoing some history / removing some commit will produce undesired effects on people that had pulled that commit. This is one of the scenarios that in git requires a `—force` flag. If you want to do such a thing, you need for now to do it from the command line ```sh $ git reset —hard THE_COMMIT_ID_YOU_WANT_TO_GO_BACK_TO $ git push -f ``` And then checkout the branch back from iceberg (which will show a detached working copy — see https://books.pharo.org/booklet-ManageCode/pdf/2020-05-12-ManageCode.pdf). G > > Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes") > > Tim
TM
Tim Mackinnon
Tue, Jun 29, 2021 10:28 AM

Hi Guille - thanks for Chipping in on this - I have bookmarked the revert commands you have mentioned and see if that works better for me (rather than flailing around and making a mess of it). Possibly this scenario is one that could get its own menu option in the future - its a quite a common thing to want to just get bak to a safe point.

For the cherry picking - I have raised an Issue (in Iceberg?) - https://github.com/pharo-vcs/iceberg/issues/1519

Tim

On 28 Jun 2021, at 13:12, Guillermo Polito guillermopolito@gmail.com wrote:

Hi Tim,

El 22 jun 2021, a las 1:39, Tim Mackinnon <tim@testit.works mailto:tim@testit.works> escribió:

Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work.

A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?)

This seems to be a feature that was not migrated in the iceberg-to-spec2 migration.
Would you mind opening an issue?

The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head?

There are two different questions in here.

  • How can you go back to some older commit?

In iceberg this is done by creating a new branch from the commit you’re interested in. The “Branch…” menu will open a pop-up to allow you creating a new branch from that point in time.
Then you can checkout that branch and work as with any other branch.

<PastedGraphic-5.png>

  • How can you undo some history (that was even pushed)?

Iceberg does not support this scenario yet, as it could be very problematic when working in teams.
Undoing some history / removing some commit will produce undesired effects on people that had pulled that commit.
This is one of the scenarios that in git requires a —force flag.

If you want to do such a thing, you need for now to do it from the command line

$ git reset —hard THE_COMMIT_ID_YOU_WANT_TO_GO_BACK_TO
$ git push -f

And then checkout the branch back from iceberg (which will show a detached working copy — see https://books.pharo.org/booklet-ManageCode/pdf/2020-05-12-ManageCode.pdf https://books.pharo.org/booklet-ManageCode/pdf/2020-05-12-ManageCode.pdf).

G

Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes")

Tim

Hi Guille - thanks for Chipping in on this - I have bookmarked the revert commands you have mentioned and see if that works better for me (rather than flailing around and making a mess of it). Possibly this scenario is one that could get its own menu option in the future - its a quite a common thing to want to just get bak to a safe point. For the cherry picking - I have raised an Issue (in Iceberg?) - https://github.com/pharo-vcs/iceberg/issues/1519 Tim > On 28 Jun 2021, at 13:12, Guillermo Polito <guillermopolito@gmail.com> wrote: > > Hi Tim, > >> El 22 jun 2021, a las 1:39, Tim Mackinnon <tim@testit.works <mailto:tim@testit.works>> escribió: >> >> Hi guys - while I mostly get along with Iceberg and can do common stuff - there are still a few things that I'm not sure on the best way to work. >> >> A recent one, was that I created a branch for an experiment - decided not to use and then went back to master to try again. However if I want to cherry pick code (particularly a few methods) - is there nothing I can use to do this easily? I can browse the branch in the repo explorer and see diffs of methods to master - but why can't I load any of those methods (or am I missing something obvious here?) > > This seems to be a feature that was not migrated in the iceberg-to-spec2 migration. > Would you mind opening an issue? > >> >> The other item that still confuses me today - how can I easily revert back to previous point in time, essentially undo work I've commited and possible pushed to my git repo. I also struggle with this one - end up with a detached head and flail around. I don't understand why this is so hard to do - and can only think its because everything is based on graphs of graphs and so there is the potential that going back in time can break this? Anyway - what is the foolproof way to go back to the older point, and then start coding so that this becomes the new Head? > > There are two different questions in here. > > - How can you go back to some older commit? > > In iceberg this is done by creating a new branch from the commit you’re interested in. The “Branch…” menu will open a pop-up to allow you creating a new branch from that point in time. > Then you can checkout that branch and work as with any other branch. > > <PastedGraphic-5.png> > > > - How can you undo some history (that was even pushed)? > > Iceberg does not support this scenario yet, as it could be very problematic when working in teams. > Undoing some history / removing some commit will produce undesired effects on people that had pulled that commit. > This is one of the scenarios that in git requires a `—force` flag. > > If you want to do such a thing, you need for now to do it from the command line > > ```sh > $ git reset —hard THE_COMMIT_ID_YOU_WANT_TO_GO_BACK_TO > $ git push -f > ``` > > And then checkout the branch back from iceberg (which will show a detached working copy — see https://books.pharo.org/booklet-ManageCode/pdf/2020-05-12-ManageCode.pdf <https://books.pharo.org/booklet-ManageCode/pdf/2020-05-12-ManageCode.pdf>). > > G > >> >> Pointers on these two items greatly appreciate for my road to vcs greatness (and gosh I mess Envy - as I haven't asked about showing me deleted "available methods" and "classes") >> >> Tim >