<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/run-command.c, branch v2.27.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.27.0</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.27.0'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2020-05-13T19:19:19Z</updated>
<entry>
<title>Merge branch 'jc/auto-gc-quiet'</title>
<updated>2020-05-13T19:19:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-13T19:19:19Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3af459e48dd275665568f3a7a6d76d90c1843e6a'/>
<id>urn:sha1:3af459e48dd275665568f3a7a6d76d90c1843e6a</id>
<content type='text'>
Teach "am", "commit", "merge" and "rebase", when they are run with
the "--quiet" option, to pass "--quiet" down to "gc --auto".

* jc/auto-gc-quiet:
  auto-gc: pass --quiet down from am, commit, merge and rebase
  auto-gc: extract a reusable helper from "git fetch"
</content>
</entry>
<entry>
<title>auto-gc: extract a reusable helper from "git fetch"</title>
<updated>2020-05-07T19:24:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-06T20:18:29Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=850b6edefa7a4fcc75149447cb8a984f804dd080'/>
<id>urn:sha1:850b6edefa7a4fcc75149447cb8a984f804dd080</id>
<content type='text'>
Back in 1991006c (fetch: convert argv_gc_auto to struct argv_array,
2014-08-16), we taught "git fetch --quiet" to pass the "--quiet"
option down to "gc --auto".  This issue, however, is not limited to
"fetch":

    $ git grep -e 'gc.*--auto' \*.c

finds hits in "am", "commit", "merge", and "rebase" and these
commands do not pass "--quiet" down to "gc --auto" when they
themselves are told to be quiet.

As a preparatory step, let's introduce a helper function
run_auto_gc(), that the caller can pass a boolean "quiet",
and redo the fix to "git fetch" using the helper.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Reviewed-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: trigger PATH lookup properly on Cygwin</title>
<updated>2020-03-27T18:06:17Z</updated>
<author>
<name>Andras Kucsma</name>
<email>r0maikx02b@gmail.com</email>
</author>
<published>2020-03-27T00:36:43Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=05ac8582bc722c8bd3ab7a0cafa681bec198a06d'/>
<id>urn:sha1:05ac8582bc722c8bd3ab7a0cafa681bec198a06d</id>
<content type='text'>
On Cygwin, the codepath for POSIX-like systems is taken in
run-command.c::start_command(). The prepare_cmd() helper
function is called to decide if the command needs to be looked
up in the PATH. The logic there is to do the PATH-lookup if
and only if it does not have any slash '/' in it. If this test
passes we end up attempting to run the command by appending the
string after each colon-separated component of PATH.

The Cygwin environment supports both Windows and POSIX style
paths, so both forwardslahes '/' and back slashes '\' can be
used as directory separators for any external program the user
supplies.

Examples for path strings which are being incorrectly searched
for in the PATH instead of being executed as is:

- "C:\Program Files\some-program.exe"
- "a\b\c.exe"

To handle these, the PATH lookup detection logic in prepare_cmd()
is taught to know about this Cygwin quirk, by introducing
has_dir_sep(path) helper function to abstract away the difference
between true POSIX and Cygwin systems.

Signed-off-by: Andras Kucsma &lt;r0maikx02b@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bc/run-command-nullness-after-free-fix'</title>
<updated>2020-01-22T23:07:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-01-22T23:07:31Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=42096c778ddfcc946ea6fc302c46f96d586b5bab'/>
<id>urn:sha1:42096c778ddfcc946ea6fc302c46f96d586b5bab</id>
<content type='text'>
C pedantry ;-) fix.

* bc/run-command-nullness-after-free-fix:
  run-command: avoid undefined behavior in exists_in_PATH
</content>
</entry>
<entry>
<title>run-command: avoid undefined behavior in exists_in_PATH</title>
<updated>2020-01-07T19:59:07Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2020-01-07T01:36:40Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=63ab08fb9999bf9547c5279a8c2f0cdd8bb679ca'/>
<id>urn:sha1:63ab08fb9999bf9547c5279a8c2f0cdd8bb679ca</id>
<content type='text'>
In this function, we free the pointer we get from locate_in_PATH and
then check whether it's NULL.  However, this is undefined behavior if
the pointer is non-NULL, since the C standard no longer permits us to
use a valid pointer after freeing it.

The only case in which the C standard would permit this to be defined
behavior is if r were NULL, since it states that in such a case "no
action occurs" as a result of calling free.

It's easy to suggest that this is not likely to be a problem, but we
know that GCC does aggressively exploit the fact that undefined
behavior can never occur to optimize and rewrite code, even when that's
contrary to the expectations of the programmer.  It is, in fact, very
common for it to omit NULL pointer checks, just as we have here.

Since it's easy to fix, let's do so, and avoid a potential headache in
the future.

Noticed-by: Miriam R. &lt;mirucam@gmail.com&gt;
Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: use prepare_git_cmd() in prepare_cmd()</title>
<updated>2019-11-27T02:22:35Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2019-11-26T09:06:36Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=54a7a64613ca6cda431bbfab3867ebe354c1e9da'/>
<id>urn:sha1:54a7a64613ca6cda431bbfab3867ebe354c1e9da</id>
<content type='text'>
Call prepare_git_cmd() instead of open-coding it.

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>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://www.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://www.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://www.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://www.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>
</feed>
