summary refs log tree commit diff
path: root/bin/man1/git-comment.1
blob: 8e958f30d6a10c8e55f92900be3320a72e1eeecc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
.Dd September 10, 2021
.Dt GIT-COMMENT 1
.Os
.
.Sh NAME
.Nm git-comment
.Nd add comments from commit messages
.
.Sh SYNOPSIS
.Nm git comment
.Op Fl \-all
.Op Fl \-comment-start Ar string
.Op Fl \-comment-lead Ar string
.Op Fl \-comment-end Ar string
.Op Fl \-min-group Ar lines
.Op Fl \-min-repeat Ar lines
.Op Fl \-no-repeat
.Op Fl \-pretty Ar format
.Op Ar options ...
.Op Fl \-
.Ar file
.
.Sh DESCRIPTION
The
.Nm
command
adds comments to a file
showing the commit messages
which last modified
each group of lines.
By default only commit messages with bodies
and which modified groups of at least 2 lines
are added.
Each comment contains
the abbreviated commit hash
and the commit summary,
followed by the commit body.
.
.Pp
.Nm
accepts all the options of
.Xr git-blame 1
in addition to the following:
.Bl -tag -width Ds
.It Fl \-all
Include all commit messages.
The default is to include
only commit messages with bodies
(lines after the summary).
.
.It Fl \-comment-start Ar string
Start comments with
.Ar string .
The default is the value of
.Cm comment.start
or
.Ql /* .
.
.It Fl \-comment-lead Ar string
Continue comments with the leading
.Ar string .
The default is the value of
.Cm comment.lead
or
.Ql " *" .
.
.It Fl \-comment-end Ar string
End comments with
.Ar string .
The default is the value of
.Cm comment.end
or
.Ql " */" .
.
.It Fl \-min-group Ar lines
Add comments only for groups of at least
.Ar lines .
The default is 2 lines.
.
.It Fl \-min-repeat Ar lines
Avoid repeating a comment
if it occurred in the last
.Ar lines .
The default is 30 lines.
.
.It Fl \-no-repeat
Avoid repeating comments entirely.
.
.It Fl \-pretty Ar format
Set the pretty-print format
to use for commit messages.
The default is the value of
.Cm comment.pretty
or
.Ql format:%h\ %s%n%n%-b .
See
.Xr git-show 1 .
.El
.
.Sh EXAMPLES
For files with
.Ql #
comments:
.Bd -literal -offset indent
git config comment.start '#'
git config comment.lead '#'
git config comment.end ''
.Ed
.
.Pp
Add as many comments as possible:
.Bd -literal -offset indent
git comment --all --min-group 1 --min-repeat 1
.Ed
.
.Sh SEE ALSO
.Xr git-blame 1
ui.c?h=1.9&id=0b429a7ccc372a3d52445ab248d1299e9abd58db&follow=1'>Define ui.c BUF_LEN with enumJune McEnroe 2018-08-07Hack clang into checking uiFmt format stringsJune McEnroe 2018-08-07Handle PART and QUIT without messagesJune McEnroe 2018-08-07Make safe filling the who bufferJune McEnroe 2018-08-07Add reverse and reset IRC formatting codesJune McEnroe 2018-08-06Rewrite line editing again, add formattingJune McEnroe 2018-08-06Fix allocation size in vaswprintfJune McEnroe This is so embarrassing. It only started crashing once it had strings that were long enough, and then it took me so long to notice this mistake. I was worried I was still doing va_list wrong somehow. 2018-08-06Implement word wrappingJune McEnroe 2018-08-06Use wchar_t strings for all of UIJune McEnroe vaswprintf is a nightmare. 2018-08-06Rename line editing functionsJune McEnroe 2018-08-05Initialize all possible color pairsJune McEnroe This is actually possible with use_default_colors! 2018-08-05Refactor color initializationJune McEnroe 2018-08-05Add ^L redrawJune McEnroe 2018-08-05Use 16 colors if availableJune McEnroe Fall back to using bold if there are only 8 colors. This also allowed bright background colors in 16-color terminals. I must port this system to torus. I'll be able to remove the awful termcap patch hack. 2018-08-05Limit parsed colors to number of mIRC colorsJune McEnroe Oh boy that's embarrassing. 2018-08-04Show source link on exitJune McEnroe 2018-08-04Implement line editing, scrollingJune McEnroe Don't really have a way to implement the M-* keys, and currently missing C-w. 2018-08-04Handle /topicJune McEnroe