Hi Peter, Le 03/03/2015 19:29, Peter Uhnák a écrit :
On Sun, Mar 1, 2015 at 8:58 PM, Thierry Goubier <thierry.goubier@gmail.com <mailto:thierry.goubier@gmail.com>> wrote:
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.
Ok. Then I would suggest you take the code source of CLANG, LLVM, OpenOffice or of the Linux kernel, you add the git hooks to call make, and you admire how fast changing branches becomes ;)
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.
Want to switch branches before committing? Can do. Want to stash? Can be added, instead of committing automagically. Remember that GitFileTree is about providing a support to allow one to experiment on the appropriate workflow: it is an enabler, not a one-size-fit-all solution. I'm not a git expert, but I know enough about git (and git users:)) that each and everyone may have its opinion on the way git should be used, and, as such, I've decided on GitFileTree that I wouldn't claim to hold the way it should be usedâ¢.
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).
Please explore the idea; just try to focus on that: - GitFileTree is just about keeping in sync Monticello and Git in a reasonable way, and understanding what is inside a Git repository. - Any git action (and you know which ones you are using), is just a few lines of Smalltalk (except the part where it reads and remap the git history to MC). Change is easy and cheap. - There is a whole world of finding the right concepts you use in your development (stashing, fast branch switching, etc) that we have to explore. And remember that some of the things I am proposing is just throwing ideas around to try to see if they fit. Don't be afraid to experiment. At the same time, there is just me and Max (and Esteban as well, I think) working on getting that git support working, so don't bash us too much. It's hard enough to get it done (look at Max questions about libcgit) that we don't need too much additional pressure. Thierry