threads / patch / 13076

patchshortlog wrap usage

Subject: [PATCH] shortlog wrap usage

## tl;dr

2 messages between Apr 12, 2008 and Apr 12, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Fredrik Noring· Apr 12, 2008, 13:05 UTC · lore
Hi all,

Found this hidden "-w" option to the shortlog command, and thought it might be good to have it documented.

  builtin-shortlog.c  |    2 +-
  man1/git-shortlog.1 |    6 +++++-
  2 files changed, 6 insertions(+), 2 deletions(-)

Thanks, Fredrik

Show changes to 2 files +6 −2

man1/git-shortlog.1, builtin-shortlog.c

diff --git a/man1/git-shortlog.1 b/man1/git-shortlog.1
index 306c821..3602ad9 100644
--- a/man1/git-shortlog.1
+++ b/man1/git-shortlog.1
@@ -13,7 +13,8 @@ git\-shortlog \- Summarize 'git log' output
 .sp
 .nf
 git\-log \-\-pretty=short | \fIgit\-shortlog\fR [\-h] [\-n] [\-s] [\-e]
-git\-shortlog [\-n|\-\-numbered] [\-s|\-\-summary] [\-e|\-\-email] [<committish>\&...]
+git\-shortlog [\-n|\-\-numbered] [\-s|\-\-summary] [\-e|\-\-email] [\-w]
+             [<committish>\&...]
 .fi
 .SH "DESCRIPTION"
 Summarizes \fIgit log\fR output in a format suitable for inclusion in release announcements. Each commit will be grouped by author and the first line of the commit message will be shown.
@@ -32,6 +33,9 @@ Suppress commit description and provide a commit count summary only.
 .TP
 \-e, \-\-email
 Show the email address of each author.
+.TP
+\-w[<width>[,<indent1>[,<indent2>]]]
+Wrap printed output.
 .SH "FILES"
 If the file .mailmap exists, it will be used for mapping author email addresses to a real author name. One mapping per line, first the author name followed by the email address enclosed by \fI<\fR and \fI>\fR. Use hash \fI#\fR for comments. Example:
 .sp
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index bd795b1..e6a2865 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -9,7 +9,7 @@
 #include "shortlog.h"
 
 static const char shortlog_usage[] =
-"git-shortlog [-n] [-s] [-e] [<commit-id>... ]";
+"git-shortlog [-n] [-s] [-e] [-w] [<commit-id>... ]";
 
 static int compare_by_number(const void *a1, const void *a2)
 {
Junio C Hamano· Apr 12, 2008, 22:37 UTC · re: Fredrik Noring · lore

[PATCH] Document -w option to shortlog

Noticed by Fredrik Noring.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/git-shortlog.txt |   10 ++++++++--
 builtin-shortlog.c             |    2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
Show changes to 2 files +9 −3

Documentation/git-shortlog.txt, builtin-shortlog.c

diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
index c775257..d7cb4c0 100644
--- a/Documentation/git-shortlog.txt
+++ b/Documentation/git-shortlog.txt
@@ -8,8 +8,8 @@ git-shortlog - Summarize 'git log' output
 SYNOPSIS
 --------
 [verse]
-git-log --pretty=short | 'git-shortlog' [-h] [-n] [-s] [-e]
-git-shortlog [-n|--numbered] [-s|--summary] [-e|--email] [<committish>...]
+git-log --pretty=short | 'git-shortlog' [-h] [-n] [-s] [-e] [-w]
+git-shortlog [-n|--numbered] [-s|--summary] [-e|--email] [-w[<width>[,<indent1>[,<indent2>]]]] [<committish>...]
 
 DESCRIPTION
 -----------
@@ -35,6 +35,12 @@ OPTIONS
 -e, \--email::
 	Show the email address of each author.
 
+-w[<width>[,<indent1>[,<indent2>]]]::
+	Linewrap the output by wrapping each line at `width`.  The first
+	line of each entry is indented by `indent1` spaces, and the second
+	and subsequent lines are indented by `indent2` spaces. `width`,
+	`indent1`, and `indent2` default to 76, 6 and 9 respectively.
+
 FILES
 -----
 
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index f08095b..01cfd7b 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -8,7 +8,7 @@
 #include "mailmap.h"
 
 static const char shortlog_usage[] =
-"git-shortlog [-n] [-s] [-e] [<commit-id>... ]";
+"git-shortlog [-n] [-s] [-e] [-w] [<commit-id>... ]";
 
 static char *common_repo_prefix;
 static int email;

← back to recent threads