Do not unset CHASE_GLOB under android as then globbing with absolute
paths breaks as the PWD is often in a path with subdirectories that are
owned by root and not world-readable (e.g. /data/data/).
I *believe* this is the reason for it.
In place of the in ed215a35f7 introduced
second bracket can also stand `~` or `^`.
Otherwise something like `[feature^] or [feature~2]` is not thrown out.
Merge commits should also be matched (indicated by a '-') for the case
that the base branches last commit is a merge commit and another branch
exists that checked out the newest commit that was merged.
Example log (from `glog`):
```
* abcdef Foo (HEAD -> feature)
* bcdefa Merge branch 'other-feature' into base (base)
|\
| * cdefab Bar (other-feature)
|/
* ...
...
```
with `git show-branch -a` output like:
```
! [base] Merge branch 'other-feature' into base
* [feature] Foo
! [other-feature] Bar
---
* [feature] Foo
-- [base] Merge branch 'other-feature' into base
+*+ [other-feature] Bar
```
Here we want `base` to be returned instead of `other-feature` and thus
'-' needs to be matched as well.
Fixes (in order of the patterns that were touched):
- Only match `*` that come between BOL and the branch name in brackets,
as another branch could be checked out at a commit containing a `*`
- Only throw out commits that were committed on our current branch and
not those that contain the branch name in the message (e.g. `test`).
- Only match until first bracket as the commit message could also
contain a pattern like `[.*]` that would be matched instead.
Also display a status: (From `git-show` manpage)
```
"G" for a good (valid) signature,
"B" for a bad signature,
"U" for a good signature with unknown validity,
"X" for a good signature that has expired,
"Y" for a good signature made by an expired key,
"R" for a good signature made by a revoked key,
"E" if the signature cannot be checked (e.g. missing key) and
"N" for no signature
```
As under OSX the -p flag does not exist, it seems safer to just use
`mktemp -d` and create the worktree under that directory.
This just has the disadvantage of one more dir to display in the `PWD`.
On system where my dotfiles are only partially installed (e.g. only
the shell) for the environment variables defined in the zprofile to take
affect, every terminal instance needs to execute zsh a login-shell.
This lead to numerous instances of the ssh-agent that were not killed
when exiting the shell. As I still need the correct env-vars like
SSH_AGENT_PID in every shell I cannot just pgrep and execute the agent
respectively.
This adds a zlogout that kills the agent spawned in the current shell.
It also stops `exec`ing `startx` as then the zlogout is not read.