<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/ident.c, branch v1.8.0.2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2012-09-16T05:58:21Z</updated>
<entry>
<title>ident.c: mark private file-scope symbols as static</title>
<updated>2012-09-16T05:58:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-09-16T05:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=dad148c35975923c7a13058c20e01bb587ace4ef'/>
<id>urn:sha1:dad148c35975923c7a13058c20e01bb587ace4ef</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>split_ident_line(): make best effort when parsing author/committer line</title>
<updated>2012-08-31T21:54:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-08-31T21:54:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e27ddb64568412b75035a05366c9f091153155ed'/>
<id>urn:sha1:e27ddb64568412b75035a05366c9f091153155ed</id>
<content type='text'>
Commits made by ancient version of Git allowed committer without
human readable name, like this (00213b17c in the kernel history):

    tree 6947dba41f8b0e7fe7bccd41a4840d6de6a27079
    parent 352dd1df32e672be4cff71132eb9c06a257872fe
    author Petr Baudis &lt;pasky@ucw.cz&gt; 1135223044 +0100
    committer  &lt;sam@mars.ravnborg.org&gt; 1136151043 +0100

    kconfig: Remove support for lxdialog --checklist

    ...

    Signed-off-by: Petr Baudis &lt;pasky@suse.cz&gt;
    Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;

When fed such a commit, --format='%ci' fails to parse it, and gives
back an empty string.  Update the split_ident_line() to be a bit
more lenient when parsing, but make sure the caller that wants to
pick up sane value from its return value does its own validation.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/ident-gecos-strbuf'</title>
<updated>2012-05-29T20:09:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-05-29T20:09:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=261ec7d02ae25ba1f5532645fa6fd790515bfa70'/>
<id>urn:sha1:261ec7d02ae25ba1f5532645fa6fd790515bfa70</id>
<content type='text'>
Fixes quite a lot of brokenness when ident information needs to be taken
from the system and cleans up the code.

By Jeff King
* jk/ident-gecos-strbuf: (22 commits)
  format-patch: do not use bogus email addresses in message ids
  ident: reject bogus email addresses with IDENT_STRICT
  ident: rename IDENT_ERROR_ON_NO_NAME to IDENT_STRICT
  format-patch: use GIT_COMMITTER_EMAIL in message ids
  ident: let callers omit name with fmt_indent
  ident: refactor NO_DATE flag in fmt_ident
  ident: reword empty ident error message
  format-patch: refactor get_patch_filename
  ident: trim whitespace from default name/email
  ident: use a dynamic strbuf in fmt_ident
  ident: use full dns names to generate email addresses
  ident: report passwd errors with a more friendly message
  drop length limitations on gecos-derived names and emails
  ident: don't write fallback username into git_default_name
  fmt_ident: drop IDENT_WARN_ON_NO_NAME code
  format-patch: use default email for generating message ids
  ident: trim trailing newline from /etc/mailname
  move git_default_* variables to ident.c
  move identity config parsing to ident.c
  fmt-merge-msg: don't use static buffer in record_person
  ...
</content>
</entry>
<entry>
<title>ident: reject bogus email addresses with IDENT_STRICT</title>
<updated>2012-05-25T03:50:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-05-24T23:32:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=8c5b1ae1b26a7512eb29e75391b8b24c0d0439e7'/>
<id>urn:sha1:8c5b1ae1b26a7512eb29e75391b8b24c0d0439e7</id>
<content type='text'>
If we come up with a hostname like "foo.(none)" because the
user's machine is not fully qualified, we should reject this
in strict mode (e.g., when we are making a commit object),
just as we reject an empty gecos username.

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>ident: rename IDENT_ERROR_ON_NO_NAME to IDENT_STRICT</title>
<updated>2012-05-25T00:16:41Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-05-24T23:28:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f9bc573fdaeaf8621008f3f49aaaa64869791691'/>
<id>urn:sha1:f9bc573fdaeaf8621008f3f49aaaa64869791691</id>
<content type='text'>
Callers who ask for ERROR_ON_NO_NAME are not so much
concerned that the name will be blank (because, after all,
we will fall back to using the username), but rather it is a
check to make sure that low-quality identities do not end up
in things like commit messages or emails (whereas it is OK
for them to end up in things like reflogs).

When future commits add more quality checks on the identity,
each of these callers would want to use those checks, too.
Rather than modify each of them later to add a new flag,
let's refactor the flag.

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>ident: let callers omit name with fmt_indent</title>
<updated>2012-05-25T00:16:40Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-05-24T23:27:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c15e1987aec562107bd8e4a9fdeebf6d27d0e53a'/>
<id>urn:sha1:c15e1987aec562107bd8e4a9fdeebf6d27d0e53a</id>
<content type='text'>
Most callers want to see all of "$name &lt;$email&gt; $date", but
a few want only limited parts, omitting the date, or even
the name. We already have IDENT_NO_DATE to handle the date
part, but there's not a good option for getting just the
email. Callers have to done one of:

  1. Call ident_default_email; this does not respect
     environment variables, nor does it promise to trim
     whitespace or other crud from the result.

  2. Call git_{committer,author}_info; this returns the name
     and email, leaving the caller to parse out the wanted
     bits.

This patch adds IDENT_NO_NAME; it stops short of adding
IDENT_NO_EMAIL, as no callers want it (nor are likely to),
and it complicates the error handling of the function.

When no name is requested, the angle brackets (&lt;&gt;) around
the email address are also omitted.

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>ident: refactor NO_DATE flag in fmt_ident</title>
<updated>2012-05-25T00:16:40Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-05-24T23:26:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=359b27add341878a13c6a8b85849b75b78246c7e'/>
<id>urn:sha1:359b27add341878a13c6a8b85849b75b78246c7e</id>
<content type='text'>
As a short-hand, we extract this flag into the local
variable "name_addr_only". It's more accurate to simply
negate this and refer to it as "want_date", which will be
less confusing when we add more NO_* flags.

While we're touching this part of the code, let's move the
call to ident_default_date() only when we are actually going
to use it, not when we have NO_DATE set, or when we get a
date from the environment.

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>ident: reword empty ident error message</title>
<updated>2012-05-25T00:16:34Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-05-24T23:26:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b00f6cfcd7232d90c4625c42eb9694d4ed2dc615'/>
<id>urn:sha1:b00f6cfcd7232d90c4625c42eb9694d4ed2dc615</id>
<content type='text'>
There's on point in printing the name, since it is by
definition the empty string if we have reached this code
path. Instead, let's be more clear that we are complaining
about the empty name, but still show the email address that
it is attached to (since that may provide some context to
the user).

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>fix off-by-one error in split_ident_line</title>
<updated>2012-05-22T18:24:11Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-05-22T06:12:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d9955fd60fa79da1e7310a55c30e2d87c227d6f9'/>
<id>urn:sha1:d9955fd60fa79da1e7310a55c30e2d87c227d6f9</id>
<content type='text'>
Commit 4b340cf split the logic to parse an ident line out of
pretty.c's format_person_part. But in doing so, it
accidentally introduced an off-by-one error that caused it
to think that single-character names were invalid.

This manifested itself as the "%an" format failing to show
anything at all for a single-character name.

Reported-by: Brian Turner &lt;bturner@atlassian.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>ident: trim whitespace from default name/email</title>
<updated>2012-05-22T16:08:49Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-05-21T23:10:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=be641abdb544f00adb7ae6fdab41f9bd5453e206'/>
<id>urn:sha1:be641abdb544f00adb7ae6fdab41f9bd5453e206</id>
<content type='text'>
Usually these values get fed to fmt_ident, which will trim
any cruft anyway, but there are a few code paths which use
them directly. Let's clean them up for the benefit of those
callers. Furthermore, fmt_ident will look at the pre-trimmed
value and decide whether to invoke ERROR_ON_NO_NAME; this
check can be fooled by a name consisting only of spaces.

Note that we only bother to clean up when we are pulling the
information from gecos or from system files. Any other value
comes from a config file, where we will have cleaned up
accidental whitespace already.

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