<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/run-command.c, branch v2.22.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.22.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.22.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-02-22T23:27:59Z</updated>
<entry>
<title>trace2: create new combined trace facility</title>
<updated>2019-02-22T23:27:59Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2019-02-22T22:25:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee4512ed481a126dadd33334186e0e759d7f2f47'/>
<id>urn:sha1:ee4512ed481a126dadd33334186e0e759d7f2f47</id>
<content type='text'>
Create a new unified tracing facility for git.  The eventual intent is to
replace the current trace_printf* and trace_performance* routines with a
unified set of git_trace2* routines.

In addition to the usual printf-style API, trace2 provides higer-level
event verbs with fixed-fields allowing structured data to be written.
This makes post-processing and analysis easier for external tools.

Trace2 defines 3 output targets.  These are set using the environment
variables "GIT_TR2", "GIT_TR2_PERF", and "GIT_TR2_EVENT".  These may be
set to "1" or to an absolute pathname (just like the current GIT_TRACE).

* GIT_TR2 is intended to be a replacement for GIT_TRACE and logs command
  summary data.

* GIT_TR2_PERF is intended as a replacement for GIT_TRACE_PERFORMANCE.
  It extends the output with columns for the command process, thread,
  repo, absolute and relative elapsed times.  It reports events for
  child process start/stop, thread start/stop, and per-thread function
  nesting.

* GIT_TR2_EVENT is a new structured format. It writes event data as a
  series of JSON records.

Calls to trace2 functions log to any of the 3 output targets enabled
without the need to call different trace_printf* or trace_performance*
routines.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/run-command-report-exec-failure-fix' into maint</title>
<updated>2018-12-15T03:24:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-12-15T03:24:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=83243020c8537d48bdaf5d6d43c4be36ad47c8b0'/>
<id>urn:sha1:83243020c8537d48bdaf5d6d43c4be36ad47c8b0</id>
<content type='text'>
A recent update accidentally squelched an error message when the
run_command API failed to run a missing command, which has been
corrected.

* jc/run-command-report-exec-failure-fix:
  run-command: report exec failure
</content>
</entry>
<entry>
<title>run-command: report exec failure</title>
<updated>2018-12-12T08:06:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-12-11T05:46:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5a329a279c7ecb5214ccc049ca659aa3ad733cf'/>
<id>urn:sha1:e5a329a279c7ecb5214ccc049ca659aa3ad733cf</id>
<content type='text'>
In 321fd823 ("run-command: mark path lookup errors with ENOENT",
2018-10-24), we rewrote the logic to execute a command by looking
in the directories on $PATH; as a side effect, a request to run a
command that is not found on $PATH is noticed even before a child
process is forked to execute it.

We however stopped to report an exec failure in such a case by
mistake.  Add a logic to report the error unless silent-exec-failure
is requested, to match the original code.

Reported-by: John Passaro &lt;john.a.passaro@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/pthreads'</title>
<updated>2018-11-18T09:23:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-18T09:23:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=26b80a841ad6f2ddff855aa9bd0000a4ba81f6ff'/>
<id>urn:sha1:26b80a841ad6f2ddff855aa9bd0000a4ba81f6ff</id>
<content type='text'>
The codebase has been cleaned up to reduce "#ifndef NO_PTHREADS".

* nd/pthreads:
  Clean up pthread_create() error handling
  read-cache.c: initialize copy_len to shut up gcc 8
  read-cache.c: reduce branching based on HAVE_THREADS
  read-cache.c: remove #ifdef NO_PTHREADS
  pack-objects: remove #ifdef NO_PTHREADS
  preload-index.c: remove #ifdef NO_PTHREADS
  grep: clean up num_threads handling
  grep: remove #ifdef NO_PTHREADS
  attr.c: remove #ifdef NO_PTHREADS
  name-hash.c: remove #ifdef NO_PTHREADS
  index-pack: remove #ifdef NO_PTHREADS
  send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c
  run-command.h: include thread-utils.h instead of pthread.h
  thread-utils: macros to unconditionally compile pthreads API
</content>
</entry>
<entry>
<title>Clean up pthread_create() error handling</title>
<updated>2018-11-05T04:42:11Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-03T08:48:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2179045fd02acca83127f8d15ccd0eeb70b17400'/>
<id>urn:sha1:2179045fd02acca83127f8d15ccd0eeb70b17400</id>
<content type='text'>
Normally pthread_create() rarely fails. But with new pthreads wrapper,
pthread_create() will return ENOSYS on a system without thread support.

Threaded code _is_ protected by HAVE_THREADS and pthread_create()
should never run in the first place. But the situation could change in
the future and bugs may sneak in. Make sure that all pthread_create()
reports the error cause.

While at there, mark these strings for translation if they aren't.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c</title>
<updated>2018-11-05T04:42:11Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-03T08:48:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab'/>
<id>urn:sha1:c0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab</id>
<content type='text'>
On systems that do not support multithread, start_async() is
implemented with fork(). This implementation details unfortunately
leak out at least in send-pack.c [1].

To keep the code base clean of NO_PTHREADS, move the this #ifdef back
to run-command.c. The new wrapper function async_with_fork() at least
helps suggest that this special "close()" is related to async in fork
mode.

[1] 09c9957cf7 (send-pack: avoid deadlock when pack-object dies early
    - 2011-04-25)

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t0061: adjust to test-tool transition</title>
<updated>2018-10-25T02:41:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-25T02:41:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f67b980771b8cda5fc2093aef6dbec5d7210dcab'/>
<id>urn:sha1:f67b980771b8cda5fc2093aef6dbec5d7210dcab</id>
<content type='text'>
</content>
</entry>
<entry>
<title>run-command: mark path lookup errors with ENOENT</title>
<updated>2018-10-25T02:06:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-10-24T07:38:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=321fd82389742398d2924640ce3a61791fd27d60'/>
<id>urn:sha1:321fd82389742398d2924640ce3a61791fd27d60</id>
<content type='text'>
Since commit e3a434468f (run-command: use the
async-signal-safe execv instead of execvp, 2017-04-19),
prepare_cmd() does its own PATH lookup for any commands we
run (on non-Windows platforms).

However, its logic does not match the old execvp call when
we fail to find a matching entry in the PATH. Instead of
feeding the name directly to execv, execvp would consider
that an ENOENT error. By continuing and passing the name
directly to execv, we effectively behave as if "." was
included at the end of the PATH. This can have confusing and
even dangerous results.

The fix itself is pretty straight-forward. There's a new
test in t0061 to cover this explicitly, and I've also added
a duplicate of the ENOENT test to ensure that we return the
correct errno for this case.

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>Replace all die("BUG: ...") calls by BUG() ones</title>
<updated>2018-05-06T10:06:13Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-05-02T09:38:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=033abf97fcbc247eabf915780181d947cfb66205'/>
<id>urn:sha1:033abf97fcbc247eabf915780181d947cfb66205</id>
<content type='text'>
In d8193743e08 (usage.c: add BUG() function, 2017-05-12), a new macro
was introduced to use for reporting bugs instead of die(). It was then
subsequently used to convert one single caller in 588a538ae55
(setup_git_env: convert die("BUG") to BUG(), 2017-05-12).

The cover letter of the patch series containing this patch
(cf 20170513032414.mfrwabt4hovujde2@sigill.intra.peff.net) is not
terribly clear why only one call site was converted, or what the plan
is for other, similar calls to die() to report bugs.

Let's just convert all remaining ones in one fell swoop.

This trick was performed by this invocation:

	sed -i 's/die("BUG: /BUG("/g' $(git grep -l 'die("BUG' \*.c)

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: use BUG() to report bugs, not die()</title>
<updated>2018-05-06T10:06:13Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-05-02T09:38:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dde74d732fc3c5fa4bc4238aa935c164ff6c2dd5'/>
<id>urn:sha1:dde74d732fc3c5fa4bc4238aa935c164ff6c2dd5</id>
<content type='text'>
The slightly misleading name die_bug() of the function intended to
report a bug is actually called always, and only reports a bug if the
passed-in parameter `err` is non-zero.

It uses die_errno() to report the bug, to helpfully include the error
message corresponding to `err`.

However, as these messages indicate bugs, we really should use BUG().
And as BUG() is a macro to be able to report the exact file and line
number, we need to convert die_bug() to a macro instead of only
replacing the die_errno() by a call to BUG().

While at it, use a name more indicative of the purpose: CHECK_BUG().

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
