<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pretty.c, branch v2.34.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.34.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.34.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-11-01T20:48:08Z</updated>
<entry>
<title>Merge branch 'hm/paint-hits-in-log-grep'</title>
<updated>2021-11-01T20:48:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-11-01T20:48:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b93d7206919e9eac22b3ca0291bce8da65960595'/>
<id>urn:sha1:b93d7206919e9eac22b3ca0291bce8da65960595</id>
<content type='text'>
"git log --grep=string --author=name" learns to highlight hits just
like "git grep string" does.

* hm/paint-hits-in-log-grep:
  grep/pcre2: fix an edge case concerning ascii patterns and UTF-8 data
  pretty: colorize pattern matches in commit messages
  grep: refactor next_match() and match_one_pattern() for external use
</content>
</entry>
<entry>
<title>Merge branch 'jk/log-warn-on-bogus-encoding'</title>
<updated>2021-10-29T22:43:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-29T22:43:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a31efa77c641ed3a71f6445da93f623351afb76e'/>
<id>urn:sha1:a31efa77c641ed3a71f6445da93f623351afb76e</id>
<content type='text'>
Squelch over-eager warning message added during this cycle.

* jk/log-warn-on-bogus-encoding:
  log: document --encoding behavior on iconv() failure
  Revert "logmsg_reencode(): warn when iconv() fails"
</content>
</entry>
<entry>
<title>Revert "logmsg_reencode(): warn when iconv() fails"</title>
<updated>2021-10-29T20:48:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-29T20:48:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0988e665e936d0c2c861dcd652bff9817e9446bf'/>
<id>urn:sha1:0988e665e936d0c2c861dcd652bff9817e9446bf</id>
<content type='text'>
This reverts commit fd680bc5 (logmsg_reencode(): warn when iconv()
fails, 2021-08-27).  Throwing a warning for each and every commit
that gets reencoded, without allowing a way to squelch, would make
it unpleasant for folks who have to deal with an ancient part of the
history in an old project that used wrong encoding in the commits.
</content>
</entry>
<entry>
<title>Merge branch 'fs/ssh-signing'</title>
<updated>2021-10-25T23:06:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-25T23:06:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18c6653da0be924f83415f987d76f6813b81f086'/>
<id>urn:sha1:18c6653da0be924f83415f987d76f6813b81f086</id>
<content type='text'>
Use ssh public crypto for object and push-cert signing.

* fs/ssh-signing:
  ssh signing: test that gpg fails for unknown keys
  ssh signing: tests for logs, tags &amp; push certs
  ssh signing: duplicate t7510 tests for commits
  ssh signing: verify signatures using ssh-keygen
  ssh signing: provide a textual signing_key_id
  ssh signing: retrieve a default key from ssh-agent
  ssh signing: add ssh key format and signing code
  ssh signing: add test prereqs
  ssh signing: preliminary refactoring and clean-up
</content>
</entry>
<entry>
<title>pretty: colorize pattern matches in commit messages</title>
<updated>2021-10-08T21:19:14Z</updated>
<author>
<name>Hamza Mahfooz</name>
<email>someguy@effective-light.com</email>
</author>
<published>2021-10-07T20:31:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a5c337922a5221d1f6d025d84e18b526df9944c'/>
<id>urn:sha1:6a5c337922a5221d1f6d025d84e18b526df9944c</id>
<content type='text'>
The "git log" command limits its output to the commits that contain strings
matched by a pattern when the "--grep=&lt;pattern&gt;" option is used, but unlike
output from "git grep -e &lt;pattern&gt;", the matches are not highlighted,
making them harder to spot.

Teach the pretty-printer code to highlight matches from the
"--grep=&lt;pattern&gt;", "--author=&lt;pattern&gt;" and "--committer=&lt;pattern&gt;"
options (to view the last one, you may have to ask for --pretty=fuller).

Also, it must be noted that we are effectively greping the content twice
(because it would be a hassle to rework the existing matching code to do
a /g match and then pass it all down to the coloring code), however it only
slows down "git log --author=^H" on this repository by around 1-2%
(compared to v2.33.0), so it should be a small enough slow down to justify
the addition of the feature.

Signed-off-by: Hamza Mahfooz &lt;someguy@effective-light.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ssh signing: preliminary refactoring and clean-up</title>
<updated>2021-09-10T21:15:51Z</updated>
<author>
<name>Fabian Stelzer</name>
<email>fs@gigacodes.de</email>
</author>
<published>2021-09-10T20:07:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b5726a5d9cabba0bd8fb6c1b25a887bc7ea4650d'/>
<id>urn:sha1:b5726a5d9cabba0bd8fb6c1b25a887bc7ea4650d</id>
<content type='text'>
Openssh v8.2p1 added some new options to ssh-keygen for signature
creation and verification. These allow us to use ssh keys for git
signatures easily.

In our corporate environment we use PIV x509 Certs on Yubikeys for email
signing/encryption and ssh keys which I think is quite common
(at least for the email part). This way we can establish the correct
trust for the SSH Keys without setting up a separate GPG Infrastructure
(which is still quite painful for users) or implementing x509 signing
support for git (which lacks good forwarding mechanisms).
Using ssh agent forwarding makes this feature easily usable in todays
development environments where code is often checked out in remote VMs / containers.
In such a setup the keyring &amp; revocationKeyring can be centrally
generated from the x509 CA information and distributed to the users.

To be able to implement new signing formats this commit:
 - makes the sigc structure more generic by renaming "gpg_output" to
   "output"
 - introduces function pointers in the gpg_format structure to call
   format specific signing and verification functions
 - moves format detection from verify_signed_buffer into the check_signature
   api function and calls the format specific verify
 - renames and wraps sign_buffer to handle format specific signing logic
   as well

Signed-off-by: Fabian Stelzer &lt;fs@gigacodes.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>logmsg_reencode(): warn when iconv() fails</title>
<updated>2021-08-27T19:43:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-08-27T18:30:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd680bc5586ab7c846e03e181e033dbc36cc7d5d'/>
<id>urn:sha1:fd680bc5586ab7c846e03e181e033dbc36cc7d5d</id>
<content type='text'>
If the user asks for a pretty-printed commit to be converted (either
explicitly with --encoding=foo, or implicitly because the commit is
non-utf8 and we want to convert it), we pass it through iconv(). If that
fails, we fall back to showing the input verbatim, but don't tell the
user that the output may be bogus.

Let's add a warning to do so, along with a mention in the documentation
for --encoding. Two things to note about the implementation:

  - we could produce the warning closer to the call to iconv() in
    reencode_string_len(), which would let us relay the value of errno.
    But this is not actually very helpful. reencode_string_len() does
    not know we are operating on a commit, and indeed does not know that
    the caller won't produce an error of its own. And the errno values
    from iconv() are seldom helpful (iconv_open() only ever produces
    EINVAL; perhaps EILSEQ from iconv() might be illuminating, but it
    can also return EINVAL for incomplete sequences).

  - if the reason for the failure is that the output charset is not
    supported, then the user will see this warning for every commit we
    try to display. That might be ugly and overwhelming, but on the
    other hand it is making it clear that every one of them has not been
    converted (and the likely outcome anyway is to re-try the command
    with a supported output encoding).

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>log: avoid loading decorations for userformats that don't need it</title>
<updated>2021-06-29T03:30:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-06-22T16:04:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2086b518366ed71caac498857b9c5765dd73ed1'/>
<id>urn:sha1:b2086b518366ed71caac498857b9c5765dd73ed1</id>
<content type='text'>
If no --decorate option is given, we default to auto-decoration. And
when that kicks in, cmd_log_init_finish() will unconditionally load the
decoration refs.

However, if we are using a user-format that does not include "%d" or
"%D", we won't show the decorations at all, so we don't need to load
them. We can detect this case and auto-disable them by adding a new
field to our userformat_want helper. We can do this even when the user
explicitly asked for --decorate, because it can't affect the output at
all.

This patch consistently reduces the time to run "git log -1 --format=%H"
on my git.git clone (with ~2k refs) from 34ms to 7ms. On a much more
extreme real-world repository (with ~220k refs), it goes from 2.5s to
4ms.

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: provide human date format</title>
<updated>2021-04-27T07:09:32Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-04-25T10:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b722d4560e9d566cb8c6cdccf08d649df146eb6b'/>
<id>urn:sha1:b722d4560e9d566cb8c6cdccf08d649df146eb6b</id>
<content type='text'>
Add the placeholders %ah and %ch to format author date and committer
date, like --date=human does, which provides more humanity date output.

Signed-off-by: ZheNing Hu &lt;adlternative@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/pretty-describe'</title>
<updated>2021-03-22T21:00:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-03-22T21:00:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=25f9326561292b45311c60879d9bc08618727973'/>
<id>urn:sha1:25f9326561292b45311c60879d9bc08618727973</id>
<content type='text'>
"git log --format='...'" learned "%(describe)" placeholder.

* rs/pretty-describe:
  archive: expand only a single %(describe) per archive
  pretty: document multiple %(describe) being inconsistent
  t4205: assert %(describe) test coverage
  pretty: add merge and exclude options to %(describe)
  pretty: add %(describe)
</content>
</entry>
</feed>
