<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ident.c, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-02-01T20:40:05Z</updated>
<entry>
<title>Merge branch 'jn/do-not-drop-username-when-reading-from-etc-mailname'</title>
<updated>2013-02-01T20:40:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-01T20:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a14daf8b9101225792341e4354699c5a2e30449a'/>
<id>urn:sha1:a14daf8b9101225792341e4354699c5a2e30449a</id>
<content type='text'>
We used to stuff "user@" and then append what we read from
/etc/mailname to come up with a default e-mail ident, but a bug
lost the "user@" part.  This is to fix it.

* jn/do-not-drop-username-when-reading-from-etc-mailname:
  ident: do not drop username when reading from /etc/mailname
</content>
</entry>
<entry>
<title>ident: do not drop username when reading from /etc/mailname</title>
<updated>2013-01-25T18:41:49Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2013-01-24T23:21:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc342a25d1b48cb53448fe0e5dde578edce3122c'/>
<id>urn:sha1:dc342a25d1b48cb53448fe0e5dde578edce3122c</id>
<content type='text'>
An earlier conversion from fgets() to strbuf_getline() in the
codepath to read from /etc/mailname to learn the default host-part
of the ident e-mail address forgot that strbuf_getline() stores the
line at the beginning of the buffer just like fgets().

The "username@" the caller has prepared in the strbuf, expecting the
function to append the host-part to it, was lost because of this.

Reported-by: Mihai Rusu &lt;dizzy@google.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ident: keep separate "explicit" flags for author and committer</title>
<updated>2012-11-16T01:47:24Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-11-15T00:34:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d6991ceedc6a6fbcc2184f8328eb1b4c88b55267'/>
<id>urn:sha1:d6991ceedc6a6fbcc2184f8328eb1b4c88b55267</id>
<content type='text'>
We keep track of whether the user ident was given to us
explicitly, or if we guessed at it from system parameters
like username and hostname. However, we kept only a single
variable. This covers the common cases (because the author
and committer will usually come from the same explicit
source), but can miss two cases:

  1. GIT_COMMITTER_* is set explicitly, but we fallback for
     GIT_AUTHOR. We claim the ident is explicit, even though
     the author is not.

  2. GIT_AUTHOR_* is set and we ask for author ident, but
     not committer ident. We will claim the ident is
     implicit, even though it is explicit.

This patch uses two variables instead of one, updates both
when we set the "fallback" values, and updates them
individually when we read from the environment.

Rather than keep user_ident_sufficiently_given as a
compatibility wrapper, we update the only two callers to
check the committer_ident, which matches their intent and
what was happening already.

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: make user_ident_explicitly_given static</title>
<updated>2012-11-16T01:47:24Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-11-15T00:34:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=452802309c422ce71f1c038357ee0775af5fb3eb'/>
<id>urn:sha1:452802309c422ce71f1c038357ee0775af5fb3eb</id>
<content type='text'>
In v1.5.6-rc0~56^2 (2008-05-04) "user_ident_explicitly_given"
was introduced as a global for communication between config,
ident, and builtin-commit.  In v1.7.0-rc0~72^2 (2010-01-07)
readers switched to using the common wrapper
user_ident_sufficiently_given().  After v1.7.11-rc1~15^2~18
(2012-05-21), the var is only written in ident.c.

Now we can make it static, which will enable further
refactoring without worrying about upsetting other code.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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.shady.money/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.shady.money/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.shady.money/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.shady.money/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.shady.money/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.shady.money/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>
</feed>
