On Sun, Mar 1, 2015 at 8:58 PM, Thierry Goubier <thierry.goub...@gmail.com> wrote:
> Hi Peter, > > Le 01/03/2015 17:00, Peter Uhnák a écrit : > >> Hi, >> >> I'm facing a problem with branches and refreshing the code. Currently I >> handle (except for commits) everything from commandline, but the problem >> is that when I switch branches I don't know how to easily refresh the >> code. What I am doing now is running loading Baseline again, but that >> feels odd. >> > > Not so odd, in truth. It looks like a perfectly fine solution, which, > maybe, could be added to the concept of baseline in a repository. > > Git revolves around branches, and being able to quickly create them, >> switch them, and merge them is important. >> >> So is there currently any solution that could resolve this? Maybe I >> could run some code that would simply load what is on the disk? If I >> switch branches for java code, the editor automatically loads new >> content without me needing to do any extra work; it would be nice to >> have something similar. >> > > Well, as you have noticed in Java, C or C++, switching branches does not > call make automatically :) > You can use git hooks for that. > > In Pharo, loading code means compiling it, so what you describe may be a > bit harder to do. However, if we consider, as above, that working in > different branches is linked to a "project" concept, with a baseline > describing this project and its dependencies, then: > > a baseline branch switch could mean: unload the current baseline, its > dependencies, followed by the switch branch, followed by a load of the > baseline (in the new branch). > This will not do. :( What if I am working on something and I want to switch branch before committing? Or stashing them somewhere? Right now I don't even see how I could use stash at all. > > On the git side, this wouldn't be hard to do. > > Another approach, a tad simpler, would be : switch branch, then all > packages already loaded in the image and existing in the branch are loaded > with the head of the new branch. This one would be easy to implement with > just a button "switch branch" in the GitFileTree repository inspector. I will have to think about it. I am used to my git workflow and now I am kind of lost how to use it properly from Pharo; since I am cut off from git. One idea that is crossing my mind is having synchronized filedumps (filetree) in a folder and not worry about git or monticello inside Pharo at all. (And when I change code outside it would magically change also inside). Peter