Skip to content

TbTb creates copy of my repo when specifying the flavor #89

@aernesto

Description

@aernesto

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:

  1. 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_dev folder and not to the Foo folder.
  2. If I type tbUseProject('Foo_dev');, TbTb complains because no file Foo_dev.json exists. 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:

  1. If no second argument is specified, then TbTb uses the flavor from the .json file -- but note that I am also suggesting to change the current behavior in this scenario; that is, no Foo_dev folder would get created.
  2. If no second argument is specified, and no flavor field exists in the .json file, TbTb behaves as it currently does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions