<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ident.c, branch v2.7.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.7.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-12-21T18:59:07Z</updated>
<entry>
<title>Merge branch 'jk/ident-loosen-getpwuid'</title>
<updated>2015-12-21T18:59:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-12-21T18:59:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5498c57cdd637eb4f42ce8e296ce9ca4ab66e289'/>
<id>urn:sha1:5498c57cdd637eb4f42ce8e296ce9ca4ab66e289</id>
<content type='text'>
When getpwuid() on the system returned NULL (e.g. the user is not
in the /etc/passwd file or other uid-to-name mappings), the
codepath to find who the user is to record it in the reflog barfed
and died.  Loosen the check in this codepath, which already accepts
questionable ident string (e.g. host part of the e-mail address is
obviously bogus), and in general when we operate fmt_ident() function
in non-strict mode.

* jk/ident-loosen-getpwuid:
  ident: loosen getpwuid error in non-strict mode
  ident: keep a flag for bogus default_email
  ident: make xgetpwuid_self() a static local helper
</content>
</entry>
<entry>
<title>ident: fix undefined variable when NO_IPV6 is set</title>
<updated>2015-12-14T21:06:00Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-12-14T20:52:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=58d29ececf8fc287d9b244c617edd174ded66b01'/>
<id>urn:sha1:58d29ececf8fc287d9b244c617edd174ded66b01</id>
<content type='text'>
Commit 00bce77 (ident.c: add support for IPv6, 2015-11-27)
moved the "gethostbyname" call out of "add_domainname" and
into the helper function "canonical_name". But when moving
the code, it forgot that the "buf" variable is passed as
"host" in the helper.

Reported-by: johan defries &lt;johandefries@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>ident: loosen getpwuid error in non-strict mode</title>
<updated>2015-12-14T19:44:38Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-12-10T21:41:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=92bcbb9b338dd27f0fd4245525093c4bce867f3d'/>
<id>urn:sha1:92bcbb9b338dd27f0fd4245525093c4bce867f3d</id>
<content type='text'>
If the user has not specified an identity and we have to
turn to getpwuid() to find the username or gecos field, we
die immediately when getpwuid fails (e.g., because the user
does not exist). This is OK for making a commit, where we
have set IDENT_STRICT and would want to bail on bogus input.

But for something like a reflog, where the ident is "best
effort", it can be pain. For instance, even running "git
clone" with a UID that is not in /etc/passwd will result in
git barfing, just because we can't find an ident to put in
the reflog.

Instead of dying in xgetpwuid_self, we can instead return a
fallback value, and set a "bogus" flag. For the username in
an email, we already have a "default_email_is_bogus" flag.
For the name field, we introduce (and check) a matching
"default_name_is_bogus" flag. As a bonus, this means you now
get the usual "tell me who you are" advice instead of just a
"no such user" error.

No tests, as this is dependent on configuration outside of
git's control. However, I did confirm that it behaves
sensibly when I delete myself from the local /etc/passwd
(reflogs get written, and commits complain).

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: keep a flag for bogus default_email</title>
<updated>2015-12-10T23:39:25Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-12-10T21:35:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19ce497cf594a3c01af33a65b27b19e7459212d6'/>
<id>urn:sha1:19ce497cf594a3c01af33a65b27b19e7459212d6</id>
<content type='text'>
If we have to deduce the user's email address and can't come
up with something plausible for the hostname, we simply
write "(none)" or ".(none)" in the hostname.

Later, our strict-check is forced to use strstr to look for
this magic string. This is probably not a problem in
practice, but it's rather ugly. Let's keep an extra flag
that tells us the email is bogus, and check that instead.

We could get away with simply setting the global in
add_domainname(); it only gets called to write into
git_default_email. However, let's make the code a little
more obvious to future readers by actually passing a pointer
to our "bogus" flag down the call-chain.

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 xgetpwuid_self() a static local helper</title>
<updated>2015-12-10T23:38:59Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-12-10T21:33:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e850194c83985396435b01b70d2db00b6d3af02e'/>
<id>urn:sha1:e850194c83985396435b01b70d2db00b6d3af02e</id>
<content type='text'>
This function is defined in wrapper.c, but nobody besides
ident.c uses it. And nobody is likely to in the future,
either, as anything that cares about the user's name should
be going through the ident code.

Moving it here is a cleanup of the global namespace, but it
will also enable further cleanups inside ident.c.

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.c: add support for IPv6</title>
<updated>2015-11-28T17:20:42Z</updated>
<author>
<name>Elia Pinto</name>
<email>gitter.spiros@gmail.com</email>
</author>
<published>2015-11-27T14:08:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=00bce77fe5b30720f4031f048abf42517b0da0ba'/>
<id>urn:sha1:00bce77fe5b30720f4031f048abf42517b0da0ba</id>
<content type='text'>
Add IPv6 support by implementing name resolution with the
protocol agnostic getaddrinfo(3) API. The old gethostbyname(3)
code is still available when git is compiled with NO_IPV6.

Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/commit-author-parsing'</title>
<updated>2014-09-19T18:38:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-19T18:38:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ff700ebacffc8fb8cf80daabfb6503cb24dca0b'/>
<id>urn:sha1:9ff700ebacffc8fb8cf80daabfb6503cb24dca0b</id>
<content type='text'>
Code clean-up.

* jk/commit-author-parsing:
  determine_author_info(): copy getenv output
  determine_author_info(): reuse parsing functions
  date: use strbufs in date-formatting functions
  record_author_date(): use find_commit_header()
  record_author_date(): fix memory leak on malformed commit
  commit: provide a function to find a header in a buffer
</content>
</entry>
<entry>
<title>date: use strbufs in date-formatting functions</title>
<updated>2014-08-27T17:32:56Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-08-27T07:57:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c33ddc2e33d51da9391a81206a1d9e4a92d97d10'/>
<id>urn:sha1:c33ddc2e33d51da9391a81206a1d9e4a92d97d10</id>
<content type='text'>
Many of the date functions write into fixed-size buffers.
This is a minor pain, as we have to take special
precautions, and frequently end up copying the result into a
strbuf or heap-allocated buffer anyway (for which we
sometimes use strcpy!).

Let's instead teach parse_date, datestamp, etc to write to a
strbuf. The obvious downside is that we might need to
perform a heap allocation where we otherwise would not need
to. However, it turns out that the only two new allocations
required are:

  1. In test-date.c, where we don't care about efficiency.

  2. In determine_author_info, which is not performance
     critical (and where the use of a strbuf will help later
     refactoring).

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>config --global --edit: create a template file if needed</title>
<updated>2014-07-25T19:23:06Z</updated>
<author>
<name>Matthieu Moy</name>
<email>Matthieu.Moy@imag.fr</email>
</author>
<published>2014-07-25T19:11:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9830534e40bd15231357965441d4fe02a6a4810e'/>
<id>urn:sha1:9830534e40bd15231357965441d4fe02a6a4810e</id>
<content type='text'>
When the user has no ~/.gitconfig file, git config --global --edit used
to launch an editor on an nonexistant file name.

Instead, create a file with a default content before launching the
editor. The template contains only commented-out entries, to save a few
keystrokes for the user. If the values are guessed properly, the user
will only have to uncomment the entries.

Advanced users teaching newbies can create a minimalistic configuration
faster for newbies. Beginners reading a tutorial advising to run "git
config --global --edit" as a first step will be slightly more guided for
their first contact with Git.

Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/split-broken-ident'</title>
<updated>2013-10-28T17:43:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-10-28T17:43:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2125261b631c429175821299ece33449dbd3ab96'/>
<id>urn:sha1:2125261b631c429175821299ece33449dbd3ab96</id>
<content type='text'>
Make the fall-back parsing of commit objects with broken author or
committer lines more robust to pick up the timestamps.

* jk/split-broken-ident:
  split_ident: parse timestamp from end of line
</content>
</entry>
</feed>
