status: refactor colopts handling
commit4d2292e9a90465cbfa23f1c170c11423d11830df
authorJeff King <peff@peff.net>
Mon, 7 May 2012 19:35:03 +0000 (7 15:35 -0400)
committerJeff King <peff@peff.net>
Tue, 8 May 2012 08:57:42 +0000 (8 04:57 -0400)
tree6d0520696bf47710ff46d19f5d46d08b8de7f633
parent5410ae422b0f3cfe604d393addcd13526e940112
status: refactor colopts handling

The current code reads the config and command-line options
into a separate "colopts" variable, and then copies the
contents of that variable into the "struct wt_status". We
can eliminate the extra variable and copy just write
straight into the wt_status struct.

This simplifies the "status" code a little bit.
Unfortunately, it makes the "commit" code one line more
complex; a side effect of the separate variable was that
"commit" did not copy the colopts variable, so any
column.status configuration had no effect.

The result still ends up cleaner, though. In the previous
version, it was unclear whether commit simply forgot to copy
the colopt variable, or whether it was intentional. Now it
explicitly turns off column options. Furthermore, if commit
later learns to respect column.status, this will make the
end result simpler. I punted on just adding that feature
now, because it was sufficiently non-obvious that it should
not go into a refactoring patch.

Signed-off-by: Jeff King <peff@peff.net>
builtin/commit.c
wt-status.h