Respect git config cl.date-order in `git cl st`

In the previous commit https://crrev.com/c/2532835 the option
to order branches by date was added. This CL adds a git config
variable cl.date-order than can be set to achive the same effect.

Change-Id: Iaf24c46c5f7b63b1e518c18aedc455808a2dc752
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2992887
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 1aaf6bf..24e3b9a 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -721,6 +721,7 @@
     self.gerrit_skip_ensure_authenticated = None
     self.git_editor = None
     self.format_full_by_default = None
+    self.is_status_commit_order_by_date = None
 
   def _LazyUpdateIfNeeded(self):
     """Updates the settings from a codereview.settings file, if available."""
@@ -831,6 +832,13 @@
       self.format_full_by_default = (result == 'true')
     return self.format_full_by_default
 
+  def IsStatusCommitOrderByDate(self):
+    if self.is_status_commit_order_by_date is None:
+      result = (RunGit(['config', '--bool', 'cl.date-order'],
+                       error_ok=True).strip())
+      self.is_status_commit_order_by_date = (result == 'true')
+    return self.is_status_commit_order_by_date
+
   def _GetConfig(self, key, default=''):
     self._LazyUpdateIfNeeded()
     return scm.GIT.GetConfig(self.GetRoot(), key, default)
@@ -3697,7 +3705,8 @@
   branch_statuses = {}
 
   alignment = max(5, max(len(FormatBranchName(c.GetBranch())) for c in changes))
-  if options.date_order:
+
+  if options.date_order or settings.IsStatusCommitOrderByDate():
     sorted_changes = sorted(changes,
                             key=lambda c: c.GetCommitDate(),
                             reverse=True)