magit/magit — pull request #1020 by tarsius (2013-10-30 18:26:45+00:00)
Title: Cleanup ref "labels"

We call the magit specific display representation of refs, "ref labels". In many cases these are identical to git's short representation of full refs, but this most not always be the case. This might be a problem, but since we currently only use these labels for display it is okay - we use different faces to tell different kinds of refs apart. Three examples:

* full-ref => short-ref => label
* `refs/remotes/origin/master` => `origin/master` => `origin/master`
* `refs/head/master` => `master` => `master`
* `refs/wip/master` => none => `master` (in a different color)

These commits cleanup the code involved in this to prepare it for future changes, and to make this more easily extendable, both by thirt-party packages as well as users:

* Previously the code involved in *formatting* also sometimes *filtered out* certain refs. That is obviously wrong (especially since the doc-strings didn't bother to mention it) and made the code very unreadable, complicated, and impossible to change, without completely rewriting it.

* `magit-refs-namespaces` is now a customizable option.

On the other hand some refs that previously were filtered out (by accident or not) no longer are. Or as I said in a commit message: "some refs are now displayed in logs, that previously were not. For some users this will be a regression, for others it will be a welcome change."

Now that *filtering* has been separated from *formatting*, formatting itself can be cleaned up - a process that will also result in an option.