4 A compact alternative to `git log --oneline` that includes dates, times
5 and author and/or committer initials in a space efficient output format.
7 The `git-log-compact` script is intended to fill the gap between the
8 `--oneline` log output format and the `--pretty=short`/`--pretty=medium`
9 output formats. It is not strictly a one line per commit output format
10 (but almost) and while it only shows the title of each commit (like the
11 `--pretty=short` format) it does include author and date information
12 (like the `--pretty=medium` format) except that timestamps are shown
13 very compactly and author/committer names are shown as initials.
15 This allows one to get a complete view of repository activity in a very
16 compact output format that can show many commits per screen full and is
17 fully compatible with the `--graph` option.
19 The `--notes`, `--pretty` and `--format` options are not allowed but any
20 other `git log` options should work fine (especially `--graph`).
22 In both `--graph` and non `--graph` modes:
24 * Root commits are identified by `_` on either side of the hash
26 When `--graph` mode is enabled, the graph output is enhanced as follows:
28 * Breaks are inserted when necessary to avoid parent/child ambiguity
34 Put the `git-log-compact` executable file in one of the directories
35 included in the `PATH` environment variable.
37 Optionally set a global alias to save typing such as `lc` like so:
39 git config --global alias.lc log-compact
41 Optionally set global default options such as `--two-initials` and
44 git config --global log-compact.defaults "--two-initials --abbrev=8"
50 Dates and times are shown in the local timezone. Set the TZ variable
51 before running `git log-compact` (e.g. `TZ=UTC git log-compact` to show
52 dates and times in UTC) or use the `--time-zone=` option (e.g.
53 `git log-compact --time-zone=UTC`) to change that.
55 Dates are shown on a date line all by themselves like so:
59 The date line indicates that the times on all the following lines
60 (regardless of whether or not `--reverse` is being used) up until
61 the next date line take place on the indicated date. For example
65 be08dee9 13:18 jc (tag: v2.6.0) Git 2.6
67 8d530c4d 13:26 jc (tag: v2.6.0-rc3) Git 2.6-rc3
68 904f6e7c 10:51 bn send-email: fix uninitialized var warning for $
70 18a21c19 09:49 ps l10n: de.po: better language for one string
71 2e0f3663 09:49 rt l10n: de.po: translate 2 messages
72 5fc31c1f 09:44 tq l10n: Update and review Vietnamese translation
74 shows one commit on 2015-09-28, two commits on 2015-09-21 and three
75 commits on 2015-09-20.
77 Note that a date line may appear more than once for the same date
78 (this is especially common when using `--graph` with its default
81 The purpose of a date line is to indicate what date has been elided
82 from the following lines, nothing more.
88 For example, running `git log-compact --decorate --graph -n 17 v2.6.1`
89 on the Git repository produces this output (which will be colorized
90 on the terminal if color is enabled):
93 * 22f698cb 19:19 jch (tag: v2.6.1) Git 2.6.1
94 * 3adc4ec7 19:16 jch Sync with v2.5.4
96 | * 24358560 15:34 jch (tag: v2.5.4) Git 2.5.4
97 | * 11a458be 15:33 jch Sync with 2.4.10
99 | | * a2558fb8 15:30 jch (tag: v2.4.10) Git 2.4.10
100 | | * 6343e2f6 15:28 jch Sync with 2.3.10
102 | | | * 18b58f70 15:26 jch (tag: v2.3.10) Git 2.3.10
103 | | | * 92cdfd21 14:59 jch Merge branch 'jk/xdiff-memory-limits
105 | | | | * 83c4d380 14:58 jk merge-file: enforce MAX_XDIFF_SIZE o
106 | | | | * dcd1742e 14:57 jk xdiff: reject files larger than ~1GB
107 | | | | * 3efb9880 14:57 jk react to errors in xdi_diff
108 | | | * | f2df3104 14:46 jch Merge branch 'jk/transfer-limit-re
110 | | | | | | === 2015-09-25 ===
111 | | | | * | b2581164 15:32 bb http: limit redirection depth
112 | | | | * | f4113cac 15:30 bb http: limit redirection to protoco
113 | | | | * | 5088d3b3 15:28 jk transport: refactor protocol white
114 | | | | | | === 2015-09-28 ===
115 | | | * | | df37727a 14:33 jch Merge branch 'jk/transfer-limit-
121 | | | | | === 2015-09-23 ===
122 | | | | * 33cfccbb 11:35 jk submodule: allow only certain protoc
124 The output will be colorized according to the same settings used to enable/
125 disable color for git log output.
127 Additionally, the color of the three new items (dates, times and
128 initials) can be controlled with the `color.log-compact.date`,
129 `color.log-compact.time` and `color.log-compact.initials` config options.
131 Running `git log-compact --graph --max-parents=0` on the Git repository gives:
134 *_0ca71b37_11:13 ap basic options parsing and whatnot.
136 *_16d6b8ab_15:16 sh Initial import of a python script to import ch
138 *_cb07fc2a_11:20 sop git-gui: Initial revision.
140 *_161332a5_10:49 ks first working version
142 *_2744b234_23:46 lt Start of early patch applicator tools for git.
144 *_1db95b00_21:08 pm Add initial version of gitk to the CVS reposit
146 *_e83c5163_15:13 lt Initial revision of "git", the information man
148 Notice the `_` on either side of the hash identifying those commits
149 as root commits. The `_` will only appear on the left side of the
150 hash if the selected output format would have normally included a
151 space there. In `--graph` mode, all the spaces between the commit mark
152 (e.g. `*`) and the hash are turned into `_`.
154 Running `git log-compact --decorate --graph --no-merges -n 13 v2.6.1`
155 on the Git repository results in this output:
158 * 22f698cb 19:19 jch (tag: v2.6.1) Git 2.6.1
160 * 24358560 15:34 jch (tag: v2.5.4) Git 2.5.4
162 * a2558fb8 15:30 jch (tag: v2.4.10) Git 2.4.10
164 * 18b58f70 15:26 jch (tag: v2.3.10) Git 2.3.10
166 * 83c4d380 14:58 jk merge-file: enforce MAX_XDIFF_SIZE on incomi
167 * dcd1742e 14:57 jk xdiff: reject files larger than ~1GB
168 * 3efb9880 14:57 jk react to errors in xdi_diff
170 | * b2581164 15:32 bb http: limit redirection depth
171 | * f4113cac 15:30 bb http: limit redirection to protocol-whitel
172 | * 5088d3b3 15:28 jk transport: refactor protocol whitelist cod
173 | | === 2015-09-23 ===
174 | * 33cfccbb 11:35 jk submodule: allow only certain protocols fo
175 | * a5adaced 11:35 jk transport: add a protocol-whitelist enviro
178 | * be08dee9 13:18 jch (tag: v2.6.0) Git 2.6
180 Notice how four linear breaks (`..........`) were automatically
181 inserted to avoid parent child relationship confusion.
183 In non `--graph` mode, linear breaks are NOT automatically inserted.
184 They must be requested with the usual `--show-linear-break` option.
190 In addition to allowing all the normal `git log` options except for
191 `--notes`, `--format` and `--pretty` (`--oneline` is allowed and
192 silently ignored), the following additional options may be utilized:
195 include seconds in the time (i.e. HH:MM:SS instead of just HH:MM)
198 include minutes but not seconds in the time (i.e. HH:MM not HH:MM:SS)
202 omit the time field entirely
205 only show at most two initials instead of the usual three
206 This is the default if `--initials=author,committer` or
207 `--initials=committer,author` is used.
210 show at most three initials
211 This is the default unless `--initials=author,committer` or
212 `--initials=committer,author` is used.
215 omit the initials field entirely
218 when using `--walk-reflogs` show commit message not reflog message
221 force use of author dates and times
222 The default is to use committer dates and times unless
223 `--author-date-order` is in effect. This option forces author
224 dates and times to always be used and overrides `--committer-date`.
227 force use of committer dates and times
228 The default is to use committer dates and times if `--date-order` or
229 `--topo-order` is in effect or `--author-date-order` is NOT in effect.
230 This option forces committer dates and times to always be used and
231 overrides a previous `--author-date` option.
233 * `--initials=author`
235 This is the default behavior
237 * `--initials=committer`
238 show committer initials instead of author initials
240 * `--initials=author,committer`
241 show author and commiter initials separated by a `/`
242 This changes the initials width default from three to two.
244 * `--initials=committer,author`
245 show commiter and author initials separated by a `/`
246 This changes the initials width default from three to two.
249 set the TZ environment variable to `zone`
250 This is an alterative to setting TZ before running `git log-compact`
251 and will affect the time zone dates and times are displayed in.
254 show the weekday with the date
257 do not show the weekday with the date
258 This is the default behavior
260 In addition to the above options, color output is controlled as normal
261 for `git log` with the addition of `color.log-compact.date`,
262 `color.log-compact.time` and `color.log-compact.initials` config options
263 to alter the default colors for dates, times and initials respectively.
265 Furthermore, default options may be set in the `log-compact.defaults`
266 config value and they will be treated as though they appeared at
267 the very beginning of the `git log-compact` command line option list
268 (e.g. `git config log-compact.defaults "--abbrev=8 --seconds"`).