]> git.ipfire.org Git - thirdparty/git.git/commit - revision.c
pretty: expand tabs in indented logs to make things line up properly
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 16 Mar 2016 16:15:53 +0000 (09:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Mar 2016 18:25:35 +0000 (11:25 -0700)
commit7cc13c717b52d3539e76f087d747f96d0d24a914
tree1553f952b73abe8b904f6991e8f16eb8c34ba8dd
parent594730e980521310d88006d91f3f14ef5eff1e2b
pretty: expand tabs in indented logs to make things line up properly

A commit log message sometimes tries to line things up using tabs,
assuming fixed-width font with the standard 8-place tab settings.
Viewing such a commit however does not work well in "git log", as
we indent the lines by prefixing 4 spaces in front of them.

This should all line up:

  Column 1 Column 2
  -------- --------
  A B
  ABCD EFGH
  SPACES        Instead of Tabs

Even with multi-byte UTF8 characters:

  Column 1 Column 2
  -------- --------
  Ä B
  åäö 100
  A Møøse once bit my sister..

Tab-expand the lines in "git log --expand-tabs" output before
prefixing 4 spaces.

This is based on the patch by Linus Torvalds, but at this step, we
require an explicit command line option to enable the behaviour.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/pretty-options.txt
commit.h
log-tree.c
pretty.c
revision.c
revision.h