Eliminate a constant expression

Clang warns that the expression graph->position < 0 is always false
because ->position is unsigned.
Merge pull request #143 from bbolli/clang-warning

Eliminate a constant expression
Fix display of all branches labels in repos with short branch names

In a fresh repository with only the master branch the "All branches"
label would be truncated to "All br".
Fix rendering glitch for branch names

Parts of the author name would randomly be shown after the branch's
commit title if the title was shorter than the author name.
Set the reference list ID during creation

Because the reference list could not be found again, this caused the
branches and tags in the list to disappear in the main view when the
references were reloaded, such as after an external command.

Fixes GH-148.
Improve invalidation during reload of references

Add valid field and only clear the reference ID after the reload so that
decoration of replaced commits will work correctly.
Create temporary file with name as suffix

This helps editors guess the filetype to properly set up their syntax
highlighting.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Use TMPDIR for temporary files

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>

Fall back to /tmp if copying fails for the environment variable.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Do not expand the graph for merges already aligned to the left

Fixes regression introduced in de7cb8abe84337fd5b628648dfda1b472e0a6c53
as part of GH-143.
Pass terminal dimensions to git by setting COLUMNS and LINES

This partially reverts "Show diff stats as wide as the terminal" (commit
a7eb3057ec70d4948ca5f2de98fcf29d844085b4) which passed the terminal
width to git-diff using `--stat=%(width)`. This feature was introduced
in Git version 1.7.10 released 2013-04-06 and causes problems for older
versions of Git.

It turns out that Git will automatically read $COLUMNS when showing diff
stats, so the same effect can be achieved by passing the terminal
dimensions using environment variables.

Fixes GH-151, "Broken commit rendering on Ubuntu 10.04" since
incompatibilitis with older versions of Git is no longer an issue.
Tested using `tig 1f384f3f5b9f0ea5a78504200eb577fcb8ba600a`.
Fix regexec() error checking in grep_text() and grep_refs()

regexec() returns 0 for success and the non-zero code REG_NOMATCH for
failure, so it should be '!result' instead of 'result != REG_NOMATCH'.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Add a log view default mode with `log` option

Like `git log`, `tig log` shows the log view by default.