<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pretty.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-11-22T04:18:59Z</updated>
<entry>
<title>log: add option to choose which refs to decorate</title>
<updated>2017-11-22T04:18:59Z</updated>
<author>
<name>Rafael Ascensão</name>
<email>rafa.almas@gmail.com</email>
</author>
<published>2017-11-21T21:33:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65516f586b69307f977cd67cc45513a296cabc25'/>
<id>urn:sha1:65516f586b69307f977cd67cc45513a296cabc25</id>
<content type='text'>
When `log --decorate` is used, git will decorate commits with all
available refs. While in most cases this may give the desired effect,
under some conditions it can lead to excessively verbose output.

Introduce two command line options, `--decorate-refs=&lt;pattern&gt;` and
`--decorate-refs-exclude=&lt;pattern&gt;` to allow the user to select which
refs are used in decoration.

When "--decorate-refs=&lt;pattern&gt;" is given, only the refs that match the
pattern are used in decoration. The refs that match the pattern when
"--decorate-refs-exclude=&lt;pattern&gt;" is given, are never used in
decoration.

These options follow the same convention for mixing negative and
positive patterns across the system, assuming that the inclusive default
is to match all refs available.

 (1) if there is no positive pattern given, pretend as if an
     inclusive default positive pattern was given;

 (2) for each candidate, reject it if it matches no positive
     pattern, or if it matches any one of the negative patterns.

The rules for what is considered a match are slightly different from the
rules used elsewhere.

Commands like `log --glob` assume a trailing '/*' when glob chars are
not present in the pattern. This makes it difficult to specify a single
ref.  On the other hand, commands like `describe --match --all` allow
specifying exact refs, but do not have the convenience of allowing
"shorthand refs" like 'refs/heads' or 'heads' to refer to
'refs/heads/*'.

The commands introduced in this patch consider a match if:

  (a) the pattern contains globs chars,
	and regular pattern matching returns a match.

  (b) the pattern does not contain glob chars,
         and ref '&lt;pattern&gt;' exists, or if ref exists under '&lt;pattern&gt;/'

This allows both behaviours (allowing single refs and shorthand refs)
yet remaining compatible with existent commands.

Helped-by: Kevin Daudt &lt;me@ikke.info&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Rafael Ascensão &lt;rafa.almas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pretty.c: delimit "%(trailers)" arguments with ","</title>
<updated>2017-10-02T00:22:52Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2017-10-01T16:18:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=84ff053d47c20c9f417f857e4adac0bcd8e01f0d'/>
<id>urn:sha1:84ff053d47c20c9f417f857e4adac0bcd8e01f0d</id>
<content type='text'>
In preparation for adding consistent "%(trailers)" atom options to
`git-for-each-ref(1)`'s "--format" argument, change "%(trailers)" in
pretty.c to separate sub-arguments with a ",", instead of a ":".

Multiple sub-arguments are given either as "%(trailers:unfold,only)" or
"%(trailers:only,unfold)".

This change disambiguates between "top-level" arguments, and arguments
given to the trailers atom itself. It is consistent with the behavior of
"%(upstream)" and "%(push)" atoms.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/trailers-parse'</title>
<updated>2017-08-27T05:55:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-27T05:55:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06cf4f2d87d670f6d49c208fa41933941205da90'/>
<id>urn:sha1:06cf4f2d87d670f6d49c208fa41933941205da90</id>
<content type='text'>
"git interpret-trailers" has been taught a "--parse" and a few
other options to make it easier for scripts to grab existing
trailer lines from a commit log message.

* jk/trailers-parse:
  doc/interpret-trailers: fix "the this" typo
  pretty: support normalization options for %(trailers)
  t4205: refactor %(trailers) tests
  pretty: move trailer formatting to trailer.c
  interpret-trailers: add --parse convenience option
  interpret-trailers: add an option to unfold values
  interpret-trailers: add an option to show only existing trailers
  interpret-trailers: add an option to show only the trailers
  trailer: put process_trailers() options into a struct
</content>
</entry>
<entry>
<title>pretty: support normalization options for %(trailers)</title>
<updated>2017-08-15T18:13:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-08-15T10:25:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=58311c66fd316dff8f2c68a634ca0cf968227870'/>
<id>urn:sha1:58311c66fd316dff8f2c68a634ca0cf968227870</id>
<content type='text'>
The interpret-trailers command recently learned some options
to make its output easier to parse (for a caller whose only
interested in picking out the trailer values). But it's not
very efficient for asking for the trailers of many commits
in a single invocation.

We already have "%(trailers)" to do that, but it doesn't
know about unfolding or omitting non-trailers. Let's plumb
those options through, so you can have the best of both.

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>pretty: move trailer formatting to trailer.c</title>
<updated>2017-08-15T18:13:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-08-15T10:23:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a388b10fc17c435df32c3875225a1468edad9535'/>
<id>urn:sha1:a388b10fc17c435df32c3875225a1468edad9535</id>
<content type='text'>
The next commit will add many features to the %(trailer)
placeholder in pretty.c. We'll need to access some internal
functions of trailer.c for that, so our options are either:

  1. expose those functions publicly

or

  2. make an entry point into trailer.c to do the formatting

Doing (2) ends up exposing less surface area, though do note
that caveats in the docstring of the new function.

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>pretty: respect color settings for %C placeholders</title>
<updated>2017-07-13T19:42:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-07-13T15:08:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18fb7ffc3dc9df081c241d6b7105b4058d5746d3'/>
<id>urn:sha1:18fb7ffc3dc9df081c241d6b7105b4058d5746d3</id>
<content type='text'>
The color placeholders have traditionally been
unconditional, showing colors even when git is not otherwise
configured to do so. This was not so bad for their original
use, which was on the command-line (and the user could
decide at that moment whether to add colors or not). But
these days we have configured formats via pretty.*, and
those should operate correctly in multiple contexts.

In 3082517 (log --format: teach %C(auto,black) to respect
color config, 2012-12-17), we gave an extended placeholder
that could be used to accomplish this. But it's rather
clunky to use, because you have to specify it individually
for each color (and their matching resets) in the format.
We shied away from just switching the default to auto,
because it is technically breaking backwards compatibility.

However, there's not really a use case for unconditional
colors. The most plausible reason you would want them is to
redirect "git log" output to a file. But there, the right
answer is --color=always, as it does the right thing both
with custom user-format colors and git-generated colors.

So let's switch to the more useful default. In the
off-chance that somebody really does find a use for
unconditional colors without wanting to enable the rest of
git's colors, we provide a new %C(always,...) to enable the
old behavior. And we can remind them of --color=always in
the documentation.

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 'rs/pretty-add-again' into maint</title>
<updated>2017-07-10T20:58:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-07-10T20:58:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=49771171e5b2802413a8645e8d1a25fafa5eca9f'/>
<id>urn:sha1:49771171e5b2802413a8645e8d1a25fafa5eca9f</id>
<content type='text'>
The pretty-format specifiers like '%h', '%t', etc. had an
optimization that no longer works correctly.  In preparation/hope
of getting it correctly implemented, first discard the optimization
that is broken.

* rs/pretty-add-again:
  pretty: recalculate duplicate short hashes
</content>
</entry>
<entry>
<title>Merge branch 'bw/config-h'</title>
<updated>2017-06-24T21:28:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-24T21:28:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f31d23a399d557d687266b4375a0436f920cc051'/>
<id>urn:sha1:f31d23a399d557d687266b4375a0436f920cc051</id>
<content type='text'>
Fix configuration codepath to pay proper attention to commondir
that is used in multi-worktree situation, and isolate config API
into its own header file.

* bw/config-h:
  config: don't implicitly use gitdir or commondir
  config: respect commondir
  setup: teach discover_git_directory to respect the commondir
  config: don't include config.h by default
  config: remove git_config_iter
  config: create config.h
</content>
</entry>
<entry>
<title>Merge branch 'rs/pretty-add-again'</title>
<updated>2017-06-24T21:28:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-24T21:28:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8af3c643d9c042d806a17fe706470a8c1acee231'/>
<id>urn:sha1:8af3c643d9c042d806a17fe706470a8c1acee231</id>
<content type='text'>
The pretty-format specifiers like '%h', '%t', etc. had an
optimization that no longer works correctly.  In preparation/hope
of getting it correctly implemented, first discard the optimization
that is broken.

* rs/pretty-add-again:
  pretty: recalculate duplicate short hashes
</content>
</entry>
<entry>
<title>config: don't include config.h by default</title>
<updated>2017-06-15T19:56:22Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-06-14T18:07:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2141fc1d20e659810245ec6ca1c143c60e033ec'/>
<id>urn:sha1:b2141fc1d20e659810245ec6ca1c143c60e033ec</id>
<content type='text'>
Stop including config.h by default in cache.h.  Instead only include
config.h in those files which require use of the config system.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
