cgit: restore sort-summary-branch patch with some modifications

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackware-id.org>