subesokun / atom-tree-view-git-status

Shows the Git repository status in the Atom tree-view
MIT License
24 stars 2 forks source link

Show branch for submodules #34

Closed chancegraff closed 2 years ago

chancegraff commented 8 years ago

image

It'd be awesome if the submodules in this project (ie the folders) showed their branch/status so I don't have to individually add all of their folders as projects, such as seen here:

image

subesokun commented 8 years ago

Hi @seegraff, definitely an interesting feature :) Personally I use only rarely submodules but others might use them more frequent. If Atom (i.e. Atom's GitRepository) allows to read our the branch name of a submodules then this feature would be possible. Any investigation in this direction would be welcome :)

chancegraff commented 8 years ago

From https://atom.io/docs/api/v0.208.0/GitRepository#instance-getDirectoryStatus

This class handles submodules automatically by taking a path argument to many of the methods. This path argument will determine which underlying repository is used.

For a repository with submodules this would have the following outcome:

repo = atom.project.getRepo()
repo.getShortHead() # 'master' 
repo.getShortHead('vendor/path/to/a/submodule') # 'dead1234' 
subesokun commented 8 years ago

Ok, technical wise this feature should be possible. The tricky part will then be to hook into the tree-view to get informed then a folder gets opened and then scan the child folders for the "submodule flag". Also the whole treeviewui.coffee needs to be more generic to support upgrading root nodes as well as the submodule folders.

Any PR will be appreciated as I'm not sure when I'll find some time to implement this feature :)

subesokun commented 2 years ago

This project is no longer maintained as Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in the official announcement. Thank you for your interest in this project and your support!