Your comments

Less importantly, an even further option could be to display the complete reference namespace, including special refs, in a truly hierarchical manner. There's the unnamed root node, it's children are the special refs like "HEAD", "MERGE_HEAD" etc., and the "ref" subtree. Each internal node, i.e. inclusive the root, "refs/", "refs/heads", "refs/remotes" etc. have the appearance and functionality as requested above. E.g. I often would like to toggle between seeing all references and seeing an arbitrary subset of references, which I would get by a checkbox associated with the root node. Similarly, I often would need that checkbox for the /refs/remotes subtree.