<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pretty.c, branch v2.9.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.9.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.9.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-07-28T18:25:50Z</updated>
<entry>
<title>Merge branch 'js/find-commit-subject-ignore-leading-blanks' into maint</title>
<updated>2016-07-28T18:25:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-28T18:25:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4966b58f3e1f295e3fb22560006b1db717b56f37'/>
<id>urn:sha1:4966b58f3e1f295e3fb22560006b1db717b56f37</id>
<content type='text'>
A helper function that takes the contents of a commit object and
finds its subject line did not ignore leading blank lines, as is
commonly done by other codepaths.  Make it ignore leading blank
lines to match.

* js/find-commit-subject-ignore-leading-blanks:
  reset --hard: skip blank lines when reporting the commit subject
  sequencer: use skip_blank_lines() to find the commit subject
  commit -C: skip blank lines at the beginning of the message
  commit.c: make find_commit_subject() more robust
  pretty: make the skip_blank_lines() function public
</content>
</entry>
<entry>
<title>Merge branch 'nd/graph-width-padded' into maint</title>
<updated>2016-07-11T17:44:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-11T17:44:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f30bb4a8144a2132568021a18972a89c1dfd3ca'/>
<id>urn:sha1:5f30bb4a8144a2132568021a18972a89c1dfd3ca</id>
<content type='text'>
"log --graph --format=" learned that "%&gt;|(N)" specifies the width
relative to the terminal's left edge, not relative to the area to
draw text that is to the right of the ancestry-graph section.  It
also now accepts negative N that means the column limit is relative
to the right border.

* nd/graph-width-padded:
  pretty.c: support &lt;direction&gt;|(&lt;negative number&gt;) forms
  pretty: pass graph width to pretty formatting for use in '%&gt;|(N)'
</content>
</entry>
<entry>
<title>Merge branch 'et/pretty-format-c-auto' into maint</title>
<updated>2016-06-27T16:56:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-06-27T16:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fbb4138cb2e6b77d1d8386f336e7813fcfd3cb02'/>
<id>urn:sha1:fbb4138cb2e6b77d1d8386f336e7813fcfd3cb02</id>
<content type='text'>
The commands in `git log` family take %C(auto) in a custom format
string.  This unconditionally turned the color on, ignoring
--no-color or with --color=auto when the output is not connected to
a tty; this was corrected to make the format truly behave as
"auto".

* et/pretty-format-c-auto:
  format_commit_message: honor `color=auto` for `%C(auto)`
</content>
</entry>
<entry>
<title>pretty: make the skip_blank_lines() function public</title>
<updated>2016-06-22T20:23:56Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-06-22T20:20:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77356122443039b4b65a7795d66b3d1fdeedcce8'/>
<id>urn:sha1:77356122443039b4b65a7795d66b3d1fdeedcce8</id>
<content type='text'>
This function will be used also in the find_commit_subject()
function.

While at it, rename the function to reflect that it skips not only
empty lines, but any lines consisting of only whitespace, too.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pretty.c: support &lt;direction&gt;|(&lt;negative number&gt;) forms</title>
<updated>2016-06-16T18:43:37Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-16T13:18:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=066790d7cb0fa22e64f1276d8a0e33d18484f62a'/>
<id>urn:sha1:066790d7cb0fa22e64f1276d8a0e33d18484f62a</id>
<content type='text'>
%&gt;|(num), %&gt;&lt;|(num) and %&lt;|(num), where num is a positive number, sets a
fixed column from the screen's left border. There is no way for us to
specifiy a column relative to the right border, which is useful when you
want to make use of all terminal space (on big screens). Use negative
num for that. Inspired by Go's array syntax (*).

(*) I know Python has this first (or before Go, at least) but the idea
didn't occur to me until I learned Go.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pretty: pass graph width to pretty formatting for use in '%&gt;|(N)'</title>
<updated>2016-06-16T18:43:36Z</updated>
<author>
<name>Josef Kufner</name>
<email>josef@kufner.cz</email>
</author>
<published>2016-06-16T13:18:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ad87c807c2b6cbfbdfb2c78412781ecc7db593d'/>
<id>urn:sha1:3ad87c807c2b6cbfbdfb2c78412781ecc7db593d</id>
<content type='text'>
Pass graph width to pretty formatting, to make N in '%&gt;|(N)'
include columns consumed by graph rendered when --graph option
is in use.

For example, in the output of

  git log --all --graph --pretty='format: [%&gt;|(20)%h] %ar%d'

this change will make all commit hashes align at 20th column from
the edge of the terminal, not from the edge of the graph.

Signed-off-by: Josef Kufner &lt;josef@kufner.cz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format_commit_message: honor `color=auto` for `%C(auto)`</title>
<updated>2016-05-27T18:24:54Z</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2016-05-27T03:46:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b15a3e005af07843116c73205742adfbab3d2e82'/>
<id>urn:sha1:b15a3e005af07843116c73205742adfbab3d2e82</id>
<content type='text'>
git-log(1) documents that when specifying the `%C(auto)` format
placeholder will "turn on auto coloring on the next %placeholders
until the color is switched again."

However, when `%C(auto)` is used, the present implementation will turn
colors on unconditionally (even if the color configuration is turned off
for the current context - for example, `--no-color` was specified or the
color is `auto` and the output is not a tty).

Update `format_commit_one` to examine the current context when a format
string of `%C(auto)` is specified, which ensures that we will not
unconditionally write colors.  This brings that behavior in line with
the behavior of `%C(auto,&lt;colorname&gt;)`, and allows the user the ability
to specify that color should be displayed only when the output is a
tty.

Additionally, add a test for `%C(auto)` and update the existing tests
for `%C(auto,...)` as they were misidentified as being applicable to
`%C(auto)`.

Tests from Jeff King.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Edward Thomson &lt;ethomson@edwardthomson.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pretty: allow tweaking tabwidth in --expand-tabs</title>
<updated>2016-03-30T19:52:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-29T23:05:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe37a9c586a65943e1bca327a1bbe1ca4a3d3023'/>
<id>urn:sha1:fe37a9c586a65943e1bca327a1bbe1ca4a3d3023</id>
<content type='text'>
When the local convention of the project is to use tab width that is
not 8, it may make sense to allow "git log --expand-tabs=&lt;n&gt;" to
tweak the output to match it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pretty: enable --expand-tabs by default for selected pretty formats</title>
<updated>2016-03-30T19:39:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-29T22:49:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0893eec85fca0f76039a96cbbcd3592ff8571c24'/>
<id>urn:sha1:0893eec85fca0f76039a96cbbcd3592ff8571c24</id>
<content type='text'>
"git log --pretty={medium,full,fuller}" and "git log" by default
prepend 4 spaces to the log message, so it makes sense to enable
the new "expand-tabs" facility by default for these formats.
Add --no-expand-tabs option to override the new default.

The change alone breaks a test in t4201 that runs "git shortlog"
on the output from "git log", and expects that the output from
"git log" does not do such a tab expansion.  Adjust the test to
explicitly disable expand-tabs with --no-expand-tabs.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pretty: expand tabs in indented logs to make things line up properly</title>
<updated>2016-03-30T18:25:35Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-03-16T16:15:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7cc13c717b52d3539e76f087d747f96d0d24a914'/>
<id>urn:sha1:7cc13c717b52d3539e76f087d747f96d0d24a914</id>
<content type='text'>
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 &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
