-
Notifications
You must be signed in to change notification settings - Fork 12
Description
My setup
Following the instructions from this wiki, I cloned my repo Foo into the TbTb default projects folder:
/MY/MATLAB/USER/PATH/projects/Foo
As I usually work on the branch dev, I specified the field
"flavor": "dev"
in the Foo.json file.
The surprising behavior
After launching MATLAB, the command tbUseProject('Foo'); automatically creates a copy of my repo and renames it by appending the branch name to the folder name, yielding the new folder:
/MY/MATLAB/USER/PATH/projects/Foo_dev
This behavior surprised me because it has the following consequences:
- If I want to make an edit to my project on the fly, without pushing my changes to GitHub, these edits should be brought to the
Foo_devfolder and not to theFoofolder. - If I type
tbUseProject('Foo_dev');, TbTb complains because no fileFoo_dev.jsonexists. If I create such file and keep the line"flavor": "dev", then TbTb will create the folder
/MY/MATLAB/USER/PATH/projects/Foo_dev_dev, which is clearly not useful to me.
To keep things consistent, it seems to me that any project living in the projects folder should be callable by tbUseProject. The solution to item 2 above is to omit the line specifying the flavor in the Foo_dev.json file.
A suggestion for improvement
But there is a more high-level question about what the intended workflow for TbTb and different branches from the same git project is. Creating one folder per branch doesn't seem ideal to me; especially if each branch requires a different .json file. Instead I could imagine an optional second argument that could be given to the tbUseProject() function, which would specify the branch (or any tree-ish) that the user intends to use during his TbTb session. TbTb would then checkout the appropriate branch, directly in the Foo folder. This suggested second argument could be designed to take priority over the field flavor from the .json file. Other situations that could occur are:
- If no second argument is specified, then TbTb uses the
flavorfrom the.jsonfile -- but note that I am also suggesting to change the current behavior in this scenario; that is, noFoo_devfolder would get created. - If no second argument is specified, and no
flavorfield exists in the.jsonfile, TbTb behaves as it currently does.