<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/run-command.c, branch v2.1.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.1.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.1.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-07-30T21:21:09Z</updated>
<entry>
<title>Merge branch 'sk/mingw-uni-fix-more'</title>
<updated>2014-07-30T21:21:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-30T21:21:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=385e171a5b56dabbe33dbef6f88e8f934a6cacda'/>
<id>urn:sha1:385e171a5b56dabbe33dbef6f88e8f934a6cacda</id>
<content type='text'>
Most of these are battle-tested in msysgit and are needed to
complete what has been merged to 'master' already.

* sk/mingw-uni-fix-more:
  Win32: enable color output in Windows cmd.exe
  Win32: patch Windows environment on startup
  Win32: keep the environment sorted
  Win32: use low-level memory allocation during initialization
  Win32: reduce environment array reallocations
  Win32: don't copy the environment twice when spawning child processes
  Win32: factor out environment block creation
  Win32: unify environment function names
  Win32: unify environment case-sensitivity
  Win32: fix environment memory leaks
  Win32: Unicode environment (incoming)
  Win32: Unicode environment (outgoing)
  Revert "Windows: teach getenv to do a case-sensitive search"
  tests: do not pass iso8859-1 encoded parameter
</content>
</entry>
<entry>
<title>Win32: don't copy the environment twice when spawning child processes</title>
<updated>2014-07-21T16:32:49Z</updated>
<author>
<name>Karsten Blees</name>
<email>blees@dcon.de</email>
</author>
<published>2014-07-17T15:38:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77734da241f97607eea8f2bb55e0e19937e918d4'/>
<id>urn:sha1:77734da241f97607eea8f2bb55e0e19937e918d4</id>
<content type='text'>
When spawning child processes via start_command(), the environment and all
environment entries are copied twice. First by make_augmented_environ /
copy_environ to merge with child_process.env. Then a second time by
make_environment_block to create a sorted environment block string as
required by CreateProcess.

Move the merge logic to make_environment_block so that we only need to copy
the environment once. This changes semantics of the env parameter: it now
expects a delta (such as child_process.env) rather than a full environment.
This is not a problem as the parameter is only used by start_command()
(all other callers previously passed char **environ, and now pass NULL).

The merge logic no longer xstrdup()s the environment strings, so do_putenv
must not free them. Add a parameter to distinguish this from normal putenv.

Remove the now unused make_augmented_environ / free_environ API.

Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Stepan Kasal &lt;kasal@ucw.cz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: use internal argv_array of struct child_process in run_hook_ve()</title>
<updated>2014-07-17T22:09:24Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-07-16T21:57:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d1d094564ac818a79465f249ca765ab7ef97d443'/>
<id>urn:sha1:d1d094564ac818a79465f249ca765ab7ef97d443</id>
<content type='text'>
Use the existing argv_array member instead of providing our own.  This
way we don't have to initialize or clean it up explicitly.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: store an optional argv_array</title>
<updated>2014-05-15T16:49:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-05-15T08:33:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c460c0ecdca46be85f6d9c845f9df7ce0e45c3c2'/>
<id>urn:sha1:c460c0ecdca46be85f6d9c845f9df7ce0e45c3c2</id>
<content type='text'>
All child_process structs need to point to an argv. For
flexibility, we do not mandate the use of a dynamic
argv_array. However, because the child_process does not own
the memory, this can make memory management with a
separate argv_array difficult.

For example, if a function calls start_command but not
finish_command, the argv memory must persist. The code needs
to arrange to clean up the argv_array separately after
finish_command runs. As a result, some of our code in this
situation just leaks the memory.

To help such cases, this patch adds a built-in argv_array to
the child_process, which gets cleaned up automatically (both
in finish_command and when start_command fails).  Callers
may use it if they choose, but can continue to use the raw
argv if they wish.

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>commit: fix patch hunk editing with "commit -p -m"</title>
<updated>2014-03-18T18:25:12Z</updated>
<author>
<name>Benoit Pierre</name>
<email>benoit.pierre@gmail.com</email>
</author>
<published>2014-03-18T10:00:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15048f8a9ace23df67161746ca76b4f46114deee'/>
<id>urn:sha1:15048f8a9ace23df67161746ca76b4f46114deee</id>
<content type='text'>
Don't change git environment: move the GIT_EDITOR=":" override to the
hook command subprocess, like it's already done for GIT_INDEX_FILE.

Signed-off-by: Benoit Pierre &lt;benoit.pierre@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: trivial style fixes</title>
<updated>2013-10-31T20:48:26Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2013-10-31T09:25:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5a50085c6b4dd7838167c6ce04042b4b563d8916'/>
<id>urn:sha1:5a50085c6b4dd7838167c6ce04042b4b563d8916</id>
<content type='text'>
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tr/fd-gotcha-fixes'</title>
<updated>2013-07-22T18:23:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-07-22T18:23:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1d1934caf1c927cb12cd76aa6ced9eab51a3d435'/>
<id>urn:sha1:1d1934caf1c927cb12cd76aa6ced9eab51a3d435</id>
<content type='text'>
Two places we did not check return value (expected to be a file
descriptor) correctly.

* tr/fd-gotcha-fixes:
  run-command: dup_devnull(): guard against syscalls failing
  git_mkstemps: correctly test return value of open()
</content>
</entry>
<entry>
<title>run-command: dup_devnull(): guard against syscalls failing</title>
<updated>2013-07-12T17:30:09Z</updated>
<author>
<name>Thomas Rast</name>
<email>trast@inf.ethz.ch</email>
</author>
<published>2013-07-12T08:58:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a77f106c7837faf6a712ea3ac720f5c4fa2feb07'/>
<id>urn:sha1:a77f106c7837faf6a712ea3ac720f5c4fa2feb07</id>
<content type='text'>
dup_devnull() did not check the return values of open() and dup2().
Fix this omission.

Signed-off-by: Thomas Rast &lt;trast@inf.ethz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVE</title>
<updated>2013-05-08T19:14:35Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2013-05-02T19:26:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=380395d094b49834c3ec804407853fd6e81de702'/>
<id>urn:sha1:380395d094b49834c3ec804407853fd6e81de702</id>
<content type='text'>
Throughout git, it is assumed that the WIN32 preprocessor symbol is
defined on native Windows setups (mingw and msvc) and not on Cygwin.
On Cygwin, most of the time git can pretend this is just another Unix
machine, and Windows-specific magic is generally counterproductive.

Unfortunately Cygwin *does* define the WIN32 symbol in some headers.
Best to rely on a new git-specific symbol GIT_WINDOWS_NATIVE instead,
defined as follows:

	#if defined(WIN32) &amp;&amp; !defined(__CYGWIN__)
	# define GIT_WINDOWS_NATIVE
	#endif

After this change, it should be possible to drop the
CYGWIN_V15_WIN32API setting without any negative effect.

[rj: %s/WINDOWS_NATIVE/GIT_WINDOWS_NATIVE/g ]

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/a-thread-only-dies-once'</title>
<updated>2013-04-19T20:45:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-04-19T20:45:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9526aa461f6c6900cb892a6fe248150ad436c0d5'/>
<id>urn:sha1:9526aa461f6c6900cb892a6fe248150ad436c0d5</id>
<content type='text'>
A regression fix for the logic to detect die() handler triggering
itself recursively.

* jk/a-thread-only-dies-once:
  run-command: use thread-aware die_is_recursing routine
  usage: allow pluggable die-recursion checks
</content>
</entry>
</feed>
