RFC: Multiple Root Folders


#1

@maxbrunsfeld is asking for the community’s comments on how Atom’s multiple-root folder support can be improved here:

If you’ve got ideas, now is the time to influence the direction of this important feature.


#2

A colleague (very oldschool developer, using Eclipse) recently told me that he works in two git branches at the same time, because he doesn’t like to have to switch between them.
So he has two clones, each one checked out with a different branch and both opened as different projects in his Eclipse instance.

Got me thinking how one weird but awesome package idea could be to have several branches of the same repo opened as different root folders in the Atom tree view. :bulb:


#3

You should be able to do this with no package right now,

Since both git and atom are folder-based there would have to be two different directories, each with a git directory. Then you could easily push and pull between them. Since atom has to support a different git repo in each root folder this should all work.


#4

Yea I know, but the idea of a package would be to not need a second directory (maybe the package would store a second branch in some temp folder where the user doesn’t have to worry about it).


#5

I like this idea for automatically putting each branch in a different root. It would effectively eliminate the need to checkout branches.

You would still need a second directory whether you call it temp or not.

The package could be given a branch name and it would create a new folder and set it up. It would create the branch if needed. It could optionally load all branch folders at once. I could even see using it for all branches.

It could use a new workflow independent of Atom. All the branch folders, including master, could live in one parent folder named for the overall project. The name of each sub-folder could be the name of the branch, with one folder named master. They would not be sub-repos, just sibling repos. Opening Atom on the parent folder would load all branch roots.

I’ll put it on my to-do list.


#6

Yea that’s what I meant. Just so the user doesn’t see or have to deal with all these folders. She just opens one repo in Atom and all those branches are available to her.

Wouldn’t that be fun? Potentially messy, but fun!


#7

If you are nice to me I’ll let you work on it. (grin)

It’s your idea so you get to make it your package and I’ll contribute;.


#8

Haha, I wish I could, and it’s probably one that wouldn’t be too complicated for someone with limited experience like me, but I have no time, I don’t think I could turn it around in any feasible amount of time. :sob:


#9

I’m not clear. Wouldn’t that break things like navigation and completion? Imagine you’re working on the release branch and completion offers new functions added to the master branch? And opening foo.c means you get to choose amongst all the branches.

At work, I use multiple branches and I’m happy that there is one Atom instance per branch.


#10

No more than any use of multiple root folders. Even though I don’t know how these problems will be solved I figure that they must be solved.

Multiple root folders are the same as multiple instances of Atom. They are just being shown in one window. So it’s only a convenience to not have to switch windows and just use tabs.


#11

This sounded attractive, so I tested it by creating ~/tmp/multiroot/a with a file foo-a and ~/tmp/multiroot/b with a file foo-b. Then I ran atom ~/tmp/multiroot/a ~/tmp/multiroot/b (which only opened the first one, so I added the second one as a root folder from the context menu in the file tree).

But I’m afraid the behavior I’m looking for is not there. Perhaps we have misunderstood each other. Here is what I see:

And then Cmd-T, and then I see the following. And then when I enter mumble into one of the files and frobnicate into the other, both words are offered by autocomplete.

I don’t understand how you’re saying that all these issues are avoided. (Well, “issues”, I’m not sure. Maybe some people prefer it this way. But I don’t, and so I prefer different Atom windows. When working in project a, I want files and completions from a, and when working in b, I want them from b.)


#12

Both screen caps you show look right to me. So I guess we have different ideas of how they should behave.

  • I’d like the option to jump between branches as you show in the first screen cap.
  • The same goes for your second screen cap. I like the option to use variables from one branch in another. Most would be the same anyway.

These are advantages to me. The good news is you can use one workflow and I can use another. There is no forcing going one.


#13

I apologize for my tone. In my initial posting, I mentioned what would happen if I’m working on the release branch but autocomplete offered a function to me that only existed in the master branch? So you can tell I prefer to keep the branches apart. By now, even my thick head has comprehended that you prefer the opposite.

I’m totally happy that Atom makes both of us happy, and now every reader knows what they need to do to be happy: Do like Mark does, or do like Kai does :grinning:

-Kai


#14

Didn’t notice.

texttogetaroundthedumb20charlimit


#15

I just had a good idea (I think). It would be nice to have a package that temporarily focuses all of atom on a select root or roots. It could be as simple as having a Disable context menu option on a root that would make that root gray. It could even be on every folder.