Pretty awesome. And the select(2) based implementation will fix a
long-standing bug where the grit process will hang when a git
process writes more than PIPE_BUF bytes to stderr or when the input
written to the git process's stdin exceeds PIPE_BUF. The old popen3
based logic writes all of stdin, then reads all of stdout, then
reads all of stderr so everything except stdout had to come in under
PIPE_BUF. This hasn't been much of an issue but is critical to our
plans on using `git cat-file --batch' and writing a bunch of SHA1s
on stdin.
Also moving toward using a common spawn method interface that's a
compatible subset of the Process.spawn method built into Ruby >=
1.9.1. The hope is that most non-MRI platforms will eventually
support Process.spawn out of the box and the ones that don't have
backports.
This removes some overhead from all native git calls in the
following ways:
- Removes a fork previously performed by Open3, which double
forks to avoid needing to Process::wait.
- Removes the need to shell escape arguments, since the git
process's argv is passed explicitly as an array.
- Removes the /bin/sh process (1 fork/exec)
Additionally, these changes allow obtaining the git process's exit
status, available as $? after any native git command invocations.
Relative paths in a <repo>.git/objects/info/alternates file are to
be expanded relative to the <repo>.git/objects directory.
Previously, they were expanded relative to the <repo>.git directory.
The current code checks in both locations for backward compatibility
with grit <= 2.3.0 but I'd rather rip it out completely.