<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/log-tree.c, branch v2.4.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.4.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.4.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-03-10T22:17:48Z</updated>
<entry>
<title>log: decorate HEAD with branch name</title>
<updated>2015-03-10T22:17:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-10T13:53:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=51ff0f27bc6bfe83da7304ef9db77f3a2a4a47b0'/>
<id>urn:sha1:51ff0f27bc6bfe83da7304ef9db77f3a2a4a47b0</id>
<content type='text'>
Currently, log decorations do not indicate which branch is checked out
and whether HEAD is detached.

When branch foo is checked out, change the "HEAD, foo" part of the
decorations to "HEAD -&gt; foo". This serves to indicate both ref
decorations (helped by the spacing) as well as their relationshsip.
As a consequence, "HEAD" without any " -&gt; " denotes a detached HEAD now.

Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/decorate-leaky-separator-color' into HEAD</title>
<updated>2015-03-10T22:17:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-10T22:17:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ab682e213d292fb921d21d25208a74ce47e2c19'/>
<id>urn:sha1:4ab682e213d292fb921d21d25208a74ce47e2c19</id>
<content type='text'>
* jc/decorate-leaky-separator-color:
  log --decorate: do not leak "commit" color into the next item
  Documentation/config.txt: simplify boolean description in the syntax section
  Documentation/config.txt: describe 'color' value type in the "Values" section
  Documentation/config.txt: have a separate "Values" section
  Documentation/config.txt: describe the structure first and then meaning
  Documentation/config.txt: explain multi-valued variables once
  Documentation/config.txt: avoid unnecessary negation
</content>
</entry>
<entry>
<title>log --decorate: do not leak "commit" color into the next item</title>
<updated>2015-03-04T19:42:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-04T19:07:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ee875852e3cb41c21c2e89a636fc1e40c4012b1'/>
<id>urn:sha1:5ee875852e3cb41c21c2e89a636fc1e40c4012b1</id>
<content type='text'>
In "git log --decorate", you would see the commit header like this:

    commit ... (HEAD, jc/decorate-leaky-separator-color)

where "commit ... (" is painted in color.diff.commit, "HEAD" in
color.decorate.head, ", " in color.diff.commit, the branch name in
color.decorate.branch and then closing ")" in color.diff.commit.

If you wanted to paint the HEAD and local branch name in the same
color as the body text (perhaps because cyan and green are too faint
on a black-on-white terminal to be readable), you would not want to
have to say

    [color "decorate"]
        head = black
        branch = black

because that you would not be able to reuse same configuration on a
white-on-black terminal.  You would naively expect

    [color "decorate"]
        head = normal
	branch = normal

to work, but unfortunately it does not.  It paints the string "HEAD"
and the branch name in the same color as the opening parenthesis or
comma between the decoration elements.  This is because the code
forgets to reset the color after printing the "prefix" in its own
color.

It theoretically is possible that some people were expecting and
relying on that the attribute set as the "diff.commit" color, which
is used to draw these opening parenthesis and inter-item comma, is
inherited by the drawing of branch names, but it is not how the
coloring works everywhere else.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jn/parse-config-slot'</title>
<updated>2014-10-20T19:23:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-20T19:23:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b94657683996402228abb1694a5db4792c424f9e'/>
<id>urn:sha1:b94657683996402228abb1694a5db4792c424f9e</id>
<content type='text'>
Code cleanup.

* jn/parse-config-slot:
  color_parse: do not mention variable name in error message
  pass config slots as pointers instead of offsets
</content>
</entry>
<entry>
<title>color_parse: do not mention variable name in error message</title>
<updated>2014-10-14T18:01:21Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-10-07T19:33:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f6c5a2968c103621adf6928a29e4895361eaa23b'/>
<id>urn:sha1:f6c5a2968c103621adf6928a29e4895361eaa23b</id>
<content type='text'>
Originally the color-parsing function was used only for
config variables. It made sense to pass the variable name so
that the die() message could be something like:

  $ git -c color.branch.plain=bogus branch
  fatal: bad color value 'bogus' for variable 'color.branch.plain'

These days we call it in other contexts, and the resulting
error messages are a little confusing:

  $ git log --pretty='%C(bogus)'
  fatal: bad color value 'bogus' for variable '--pretty format'

  $ git config --get-color foo.bar bogus
  fatal: bad color value 'bogus' for variable 'command line'

This patch teaches color_parse to complain only about the
value, and then return an error code. Config callers can
then propagate that up to the config parser, which mentions
the variable name. Other callers can provide a custom
message. After this patch these three cases now look like:

  $ git -c color.branch.plain=bogus branch
  error: invalid color value: bogus
  fatal: unable to parse 'color.branch.plain' from command-line config

  $ git log --pretty='%C(bogus)'
  error: invalid color value: bogus
  fatal: unable to parse --pretty format

  $ git config --get-color foo.bar bogus
  error: invalid color value: bogus
  fatal: unable to parse default color value

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pass config slots as pointers instead of offsets</title>
<updated>2014-10-14T18:01:05Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2014-10-07T19:16:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8852117a603c5ed5131233a80453db37c0958871'/>
<id>urn:sha1:8852117a603c5ed5131233a80453db37c0958871</id>
<content type='text'>
Many config-parsing helpers, like parse_branch_color_slot,
take the name of a config variable and an offset to the
"slot" name (e.g., "color.branch.plain" is passed along with
"13" to effectively pass "plain"). This is leftover from the
time that these functions would die() on error, and would
want the full variable name for error reporting.

These days they do not use the full variable name at all.
Passing a single pointer to the slot name is more natural,
and lets us more easily adjust the callers to use skip_prefix
to avoid manually writing offset numbers.

This is effectively a continuation of 9e1a5eb, which did the
same for parse_diff_color_slot. This patch covers all of the
remaining similar constructs.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'hj/pretty-naked-decoration'</title>
<updated>2014-09-29T19:36:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-29T19:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b8e533f12acec63242c5405286fbbcfa66eecfdd'/>
<id>urn:sha1:b8e533f12acec63242c5405286fbbcfa66eecfdd</id>
<content type='text'>
The pretty-format specifier "%d", which expanded to " (tagname)"
for a tagged commit, gained a cousin "%D" that just gives the
"tagname" without frills.

* hj/pretty-naked-decoration:
  pretty: add %D format specifier
</content>
</entry>
<entry>
<title>pretty: add %D format specifier</title>
<updated>2014-09-18T22:15:21Z</updated>
<author>
<name>Harry Jeffery</name>
<email>harry@exec64.co.uk</email>
</author>
<published>2014-09-18T20:53:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9271095cc5571e306d709ebf8eb7f0a388254d9d'/>
<id>urn:sha1:9271095cc5571e306d709ebf8eb7f0a388254d9d</id>
<content type='text'>
Add a new format specifier, '%D' that is identical in behaviour to '%d',
except that it does not include the ' (' prefix or ')' suffix provided
by '%d'.

Signed-off-by: Harry Jeffery &lt;harry@exec64.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/name-decoration-alloc'</title>
<updated>2014-09-11T17:33:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-11T17:33:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ebe6a825a1ff12e12905e28265aa30e269700d6'/>
<id>urn:sha1:1ebe6a825a1ff12e12905e28265aa30e269700d6</id>
<content type='text'>
The API to allocate the structure to keep track of commit
decoration was cumbersome to use, inviting lazy code to
overallocate memory.

* jk/name-decoration-alloc:
  log-tree: use FLEX_ARRAY in name_decoration
  log-tree: make name_decoration hash static
  log-tree: make add_name_decoration a public function
</content>
</entry>
<entry>
<title>log-tree: use FLEX_ARRAY in name_decoration</title>
<updated>2014-08-27T14:44:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-08-26T10:24:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e3dfb216991974b60fdb1933eb3331e03383e61'/>
<id>urn:sha1:2e3dfb216991974b60fdb1933eb3331e03383e61</id>
<content type='text'>
We are already using the flex-array technique; let's
annotate it with our usual FLEX_ARRAY macro. Besides being
more readable, this is slightly more efficient on compilers
that understand flex-arrays.

Note that we need to bump the allocation in add_name_decoration,
which did not explicitly add one byte for the NUL terminator
of the string we are putting into the flex-array (it did not
need to before, because the struct itself was over-allocated
by one byte).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
