Commit Graph

8258 Commits

Author SHA1 Message Date
Johannes Sixt
d576539c92 Do not skip the initialization of the date string.
Due to some rebasing in the past, new functions that have been introduced
upstream moved into the MinGW portion of the #ifdefs just by coincidend,
but the initialization of the date string remained in the original spot.
The consequence was that all commits that did not use GIT_*_DATE were
created with an empty date part.

This removes the second instance of setup_ident(), which was lacking
the initialization.
2007-01-22 17:06:51 +01:00
Johannes Sixt
562cd8385d In the host:/path notation require 'host' to be at least 2 chars long.
This is necessary to distinguish the notation from the DOS-style
C:/path notation with a drive letter.
2007-01-22 14:19:23 +01:00
Johannes Sixt
306e27d8ee Recommend msysDTK for perl and ssh. 2007-01-22 14:18:14 +01:00
Johannes Sixt
cedb5fd680 Work around CF-LF mismatches introduced by non-MinGW tools. 2007-01-19 16:36:31 +01:00
Johannes Sixt
32713b4612 Work around missing tools on MinGW.
egrep cannot be called from the Windows command line.
dd and sum are not available.
2007-01-19 16:36:31 +01:00
Johannes Sixt
f603a1c562 Use the git wrapper to invoke git commit. 2007-01-19 16:36:31 +01:00
Johannes Sixt
6e5bd6187c Even more tests to skip due to missing symbolic link support. 2007-01-19 16:36:31 +01:00
Johannes Schindelin
8e128cd8c1 fix more tests for lacking symlinks 2007-01-19 16:36:31 +01:00
Johannes Schindelin
3e70ecba72 prepare more tests for lacking symlinks 2007-01-19 16:36:31 +01:00
Johannes Schindelin
cb0ad0c0af fix t0000 for absence of symlinks 2007-01-19 16:36:31 +01:00
Johannes Sixt
b61aae484e Add a README.MinGW with instructions. 2007-01-19 16:36:08 +01:00
Johannes Sixt
2d6dacec88 Make upload-pack.c work under MinGW.
The forked rev-list process is turned into a thread. This should be OK
since the rest of upload-pack does not access the revision machinery.

In order to avoid the poll() call that waits for two file descriptors,
it was necessary to remove sideband support. Then only one file descriptor
needs to be monitored, which can be done in a simple while loop.
2007-01-19 16:36:03 +01:00
Johannes Sixt
c84f02153b Add a spawnv_git_cmd() function and use it in fetch-pack.c.
This function is intended to be used in place of exec[vl]_git_cmd() that
follows a fork.  It constructs the (at most) 3 paths that execv_git_cmd()
searches manually for the git command and hands them over to
spawnvppe_pipe().

The use case in get_pack() is one of the simplest possible.
2007-01-19 16:35:55 +01:00
Johannes Sixt
c823cea00e Implement sleep(). 2007-01-19 16:35:40 +01:00
Johannes Sixt
16ea9c7aa3 Make sure that the pager terminates before the process that feeds it.
Since the pager was spawned as child process, it does not notice when
the parent (which feeds its stdin) terminates. If the pager is 'less'
it so looses control over the terminal and cannot be controled by
the user anymore. For this reason, we register a function atexit()
that explicitly waits for the pager to terminate.
2007-01-19 16:35:32 +01:00
Johannes Sixt
85e94b981e Do not leak pipe file handles into the child processes.
Windows's _pipe() by default allocates inheritable pipes. However,
when a spawn happens, we do not have a possiblility to close the unused
pipe ends in the child process. This is a problem.

Consider the following situation: The child process only reads from the
pipe and the parent process uses only the writable end; the parent even
closes the writable end. As it happens, the child at this time usually
still waits for input in a read(). But since the child has inherited
an open writable end, it does not get EOF and hangs ad infinitum.

For this reason, pipe handles must not be inheritable. At the first
glance, this is curious, since after all it is the purpose of pipes to be
inherited by child processes.  However, in all cases where this
inheritance is needed for a file descriptor, it is dup2()'d to stdin or
stdout anyway, and, lo and behold, Windows's dup2() creates inheritable
duplicates.
2007-01-19 16:35:16 +01:00
Johannes Sixt
ec1fcbb0a9 Make the pager work. 2007-01-19 16:35:11 +01:00
Johannes Sixt
5f38ff014e Split PATH into parts in advance, and pass the result to the new spawnvppe_pipe. 2007-01-19 16:34:59 +01:00
Johannes Sixt
23960ed3c3 Enable the spawn workhorse function to spawn shell scripts.
For this purpose the path lookup is done manually, and the found file
is inspected for the interpreter. If one is found, the script is spawned
under the interpreter; otherwise, the program is spawned normally.
2007-01-19 16:32:23 +01:00
Johannes Sixt
09653a29cf Move script detection into a helper function that returns the interpreter.
This will be needed later in the spawn helper functions, too,
where we want to start a shell or perl script from an exe.
2007-01-19 16:32:23 +01:00
Johannes Sixt
4ba0bd54b3 rename() fails on Windows if the destination exists. 2007-01-19 16:32:23 +01:00
Johannes Sixt
2bd27c7c97 Report failure when a process cannot be spawned (MinGW only). 2007-01-19 16:32:23 +01:00
Johannes Sixt
e7a70c5ddf Windows does not have the close-on-exec flag. 2007-01-19 16:32:23 +01:00
Johannes Sixt
8f9e40a396 Use the spawn workhorse instead of a fork()/exec() pair. 2007-01-19 16:32:23 +01:00
Johannes Sixt
0400c502c3 Factor fork()/exec() work into a spawn() like function.
Windows does not have fork(), but something called spawn() that is roughly
equivalent to a fork()/exec() pair, factor out the Unix style code into
a function that does it more similarly to spawn(). Now the Windows style
spawn() can more easily be employed to achieve the same that the Unix style
code does.
2007-01-19 16:32:23 +01:00
Johannes Sixt
aa0dba9443 Add a cpio emulation script based on GNU tar. 2007-01-19 16:32:23 +01:00
Johannes Sixt
4b5821b21b Implement a subset of waitpid() in terms of Windows's _cwait(). 2007-01-19 16:32:23 +01:00
Johannes Sixt
ee4a2fe93d MinGW cannot support sideband communication. 2007-01-19 16:31:58 +01:00
Johannes Sixt
0bb0ca2158 Windows cannot unlink() a file that is read-only. 2007-01-19 16:27:30 +01:00
Johannes Sixt
48f967a161 Make a pipe() wrapper that uses Windows's _pipe(). 2007-01-19 16:27:30 +01:00
Johannes Sixt
ff61d9fc99 Work around missing EISDIR errno values.
Windows does not return EISDIR when a directory is opened as file.
These instances are detected by checking explicitly whether the offending
file is indeed a directory, and then the errno value is adjusted accordingly.
2007-01-19 16:27:30 +01:00
Johannes Sixt
2de27f2cbb Implement a wrapper of execve that can invoke shell scripts.
When an external git command is invoked, it can be a Bourne shell script.
This patch looks into the command file to see whether it is one.
In this case, the command line is rearranged to invoke the shell
with the proper arguments.

Moreover, the arguments are quoted if necessary because Windows'
spawn functions paste the arguments again into a command line that
is disassembled by the invoked process.
2007-01-19 16:27:30 +01:00
Johannes Sixt
90262b5fae Use the Windows style PATH separator. 2007-01-19 16:25:15 +01:00
Johannes Sixt
d9634b14f9 Windows does not support C99 format strings. 2007-01-19 16:25:15 +01:00
Johannes Sixt
861429a7c3 Be prepared for DOS-like drive letters in the getcwd() result.
An earlier patch has implemented getcwd() so that it converts the
drive letter into the POSIX-like path that is used internally by
MinGW (C:\foo => /c/foo), but this style does not work outside
the MinGW shell. It is better to just convert the backslashes
to forward slashes and handle the drive letter explicitly.
2007-01-19 16:25:15 +01:00
Johannes Sixt
5a9f377e1d Add back the exec_path checks that were removed inadvertedly. 2007-01-19 16:25:15 +01:00
Johannes Sixt
4720571a2d Fix mkstemp emulation to not free the template string.
The template argument was strduped unnecessarily and then not used,
and the wrong string was freed.
2007-01-19 16:25:15 +01:00
Johannes Schindelin
c9467728c6 close fd before renaming 2007-01-19 16:24:49 +01:00
Johannes Schindelin
1c68fe96bc unlink target of rename before renaming 2007-01-19 16:24:49 +01:00
Johannes Schindelin
41dfee75f1 fix 'git bla' for .exe files 2007-01-19 16:24:49 +01:00
Johannes Schindelin
4a4ae17738 close fd of lockfile before unlinking 2007-01-19 16:24:49 +01:00
Johannes Schindelin
9c6663c419 strip extension and handle DRIVE: notation 2007-01-19 16:24:49 +01:00
Johannes Schindelin
8d1bfddd0c make default open mode O_BINARY 2007-01-19 16:24:49 +01:00
Johannes Schindelin
27317da439 implement mkstemp() 2007-01-19 16:24:49 +01:00
Johannes Schindelin
b4792a360e Include fnmatch from GNU make. 2007-01-19 16:24:48 +01:00
Johannes Schindelin
649a5ce8d6 require regex (http://ftp.gnu.org/pub/gnu/regex/) 2007-01-19 16:24:48 +01:00
Johannes Schindelin
65e40a6195 Provide inlined mkdir wrapper. 2007-01-19 16:24:48 +01:00
Johannes Sixt
14cd939112 Make git compile under MinGW.
These changes are courtesy Johannes Schindelin.
2007-01-19 16:21:41 +01:00
Johannes Sixt
9983977758 Move the revision walker into a separate function. 2007-01-19 15:04:10 +01:00
Simon 'corecode' Schubert
5d889b9810 Lose perl dependency.
Perl is just used to reverse stdin, which can be done with a simple
sed construct as well.

Signed-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
2007-01-19 15:02:25 +01:00