tg: the great LC_ALL=C out
commit144d7cfe8dcd12bf489c508031520b24e06644f1
authorKyle J. McKay <mackyle@gmail.com>
Fri, 24 Mar 2017 17:33:08 +0000 (24 10:33 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Fri, 24 Mar 2017 17:33:08 +0000 (24 10:33 -0700)
tree80850c63e8801d17b7902d046efc65874cb6b713
parent4c717beaa5aefa81b98fedcfdc37b60b033c577f
tg: the great LC_ALL=C out

Replace uses of "LC_ALL=C some command here" with just the
plain "some command here" and provide one-liner wrapper functions
for the utilities that set LC_ALL=C and run them.

Would it be possible to just set LC_ALL=C && export LC_ALL?

Yes, yes it would, but then any Git translations that might be
shown would always be disabled in favor of the default English
version which is not very friendly.

Alternatively the original value of LC_ALL could be saved and
then all Git commands run with "LC_ALL=$saved git some command"
which is even a bit more ugly than what was previously going
on with LC_ALL=C.

If LC_ALL=C is not used, many commands run just a little bit
slower as they often end up using a UTF-8 locale which incurs
performance penalties compared to LC_ALL=C.  Additionally, some
versions of sort are known to sort incorrectly in UTF-8 locales.

So yes, it really is necessary to use LC_ALL=C.  By using the
little helper functions previous invocations that were missing
the LC_ALL=C now get it too.  And the code is much easier to read.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
hooks/pre-commit.sh
tg-contains.sh
tg-delete.sh
tg-info.sh
tg-next.sh
tg-revert.sh
tg-summary.sh
tg-tag.sh
tg-update.sh
tg.sh