[PATCH] Invert numbers and names in the git-shortlog summary mode.
Also make it `cut` friendly using a tab to separate the numbers and names.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
On Tue, Dec 11, 2007 at 02:05:08PM +0000, Ingo Molnar wrote:
> please switch around the column too so that the commit count comes
> first, this is way too ugly:
>
> Junio C Hamano: 4826
> Shawn O. Pearce: 1146
> Linus Torvalds: 950
[...] Agreed, here is the patch that does that, and a sample output is:
$ git shortlog -n -s -e HEAD -- builtin-commit.c
11 Junio C Hamano <gitster@pobox.com>
6 Johannes Schindelin <Johannes.Schindelin@gmx.de>
6 Kristian Høgsberg <krh@redhat.com>
2 Jeff King <peff@peff.net>
1 Alex Riesen <raa.lkml@gmail.com>
1 Pierre Habouzit <madcoder@debian.org>
1 Shawn Bohrer <shawn.bohrer@gmail.com>
1 Wincent Colaiuta <win@wincent.com> builtin-shortlog.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 13df0c6..90666cb 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -265,7 +265,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
struct path_list *onelines = list.items[i].util;
if (summary) {
- printf("%s: %d\n", list.items[i].path, onelines->nr);
+ printf("%6d\t%s\n", onelines->nr, list.items[i].path);
} else {
printf("%s (%d):\n", list.items[i].path, onelines->nr);
for (j = onelines->nr - 1; j >= 0; j--) {
--
1.5.3.7.2226.g8312-dirty