<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/bugreport.c, branch v2.33.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.33.6</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.33.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-08-25T21:39:08Z</updated>
<entry>
<title>use xopen() to handle fatal open(2) failures</title>
<updated>2021-08-25T21:39:08Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-08-25T20:16:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66e905b7dd0f4e9dd576be681f30fbaeeb19ec4a'/>
<id>urn:sha1:66e905b7dd0f4e9dd576be681f30fbaeeb19ec4a</id>
<content type='text'>
Add and apply a semantic patch for using xopen() instead of calling
open(2) and die() or die_errno() explicitly.  This makes the error
messages more consistent and shortens the code.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/bugreport: don't leak prefixed filename</title>
<updated>2021-04-28T00:25:45Z</updated>
<author>
<name>Andrzej Hunt</name>
<email>ajrhunt@google.com</email>
</author>
<published>2021-04-25T14:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4fa268738ca91347be0945c9ef12dd1ace0e70da'/>
<id>urn:sha1:4fa268738ca91347be0945c9ef12dd1ace0e70da</id>
<content type='text'>
prefix_filename() returns newly allocated memory, and strbuf_addstr()
doesn't take ownership of its inputs. Therefore we have to make sure to
store and free prefix_filename()'s result.

As this leak is in cmd_bugreport(), we could just as well UNLEAK the
prefix - but there's no good reason not to just free it properly. This
leak was found while running t0091, see output below:

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x49ab79 in realloc /home/abuild/rpmbuild/BUILD/llvm-11.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:164:3
    #1 0x9acc66 in xrealloc wrapper.c:126:8
    #2 0x93baed in strbuf_grow strbuf.c:98:2
    #3 0x93c6ea in strbuf_add strbuf.c:295:2
    #4 0x69f162 in strbuf_addstr ./strbuf.h:304:2
    #5 0x69f083 in prefix_filename abspath.c:277:2
    #6 0x4fb275 in cmd_bugreport builtin/bugreport.c:146:9
    #7 0x4cd91d in run_builtin git.c:467:11
    #8 0x4cb5f3 in handle_builtin git.c:719:3
    #9 0x4ccf47 in run_argv git.c:808:4
    #10 0x4caf49 in cmd_main git.c:939:19
    #11 0x69df9e in main common-main.c:52:11
    #12 0x7f523a987349 in __libc_start_main (/lib64/libc.so.6+0x24349)

Signed-off-by: Andrzej Hunt &lt;ajrhunt@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/bugreport.c: use thread-safe localtime_r()</title>
<updated>2020-12-01T21:05:37Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2020-12-01T00:30:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4f6460df55cdccdda9d2a0aad4c6b578c007e01a'/>
<id>urn:sha1:4f6460df55cdccdda9d2a0aad4c6b578c007e01a</id>
<content type='text'>
To generate its filename, the 'git bugreport' builtin asks the system
for the current time with 'localtime()'. Since this uses a shared
buffer, it is not thread-safe.

Even though 'git bugreport' is not multi-threaded, using localtime() can
trigger some static analysis tools to complain, and a quick

    $ git grep -oh 'localtime\(_.\)\?' -- **/*.c | sort | uniq -c

shows that the only usage of the thread-unsafe 'localtime' is in a piece
of documentation.

So, convert this instance to use the thread-safe version for
consistency, and to appease some analysis tools.

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/slimmed-down'</title>
<updated>2020-09-03T19:37:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-03T19:37:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afd49c39dd0089ab887f77be0a8a5a2fc5054cfa'/>
<id>urn:sha1:afd49c39dd0089ab887f77be0a8a5a2fc5054cfa</id>
<content type='text'>
Trim an unused binary and turn a bunch of commands into built-in.

* jk/slimmed-down:
  drop vcs-svn experiment
  make git-fast-import a builtin
  make git-bugreport a builtin
  make credential helpers builtins
  Makefile: drop builtins from MSVC pdb list
</content>
</entry>
<entry>
<title>make git-bugreport a builtin</title>
<updated>2020-08-13T18:02:12Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-08-13T14:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7a5649c82dfa83ba8d0253e4140f242dca859a7'/>
<id>urn:sha1:d7a5649c82dfa83ba8d0253e4140f242dca859a7</id>
<content type='text'>
There's no reason that bugreport has to be a separate binary. And since
it links against libgit.a, it has a rather large disk footprint. Let's
make it a builtin, which reduces the size of a stripped installation
from 24MB to 22MB.

This also simplifies our Makefile a bit. And we can take advantage of
builtin niceties like RUN_SETUP_GENTLY.

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