Commit Graph

8241 Commits

Author SHA1 Message Date
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
Johannes Sixt
cdea3553ef Split the big verify-pack test into individual tests.
This makes it easier to spot which of the tests failed.
2007-01-19 15:01:57 +01:00
Junio C Hamano
06de51fb2f Merge branch 'master' into next
* master:
  Documentation: Generate command lists.
  Documentation: sync git.txt command list and manual page title
  Documentation: move command list in git.txt into separate files.
  prune-packed: add -q to usage
  Document --ignore-if-in-upstream in git-format-patch
  Shell syntax fix in git-reset
  Use standard -t option for touch.
  Use fixed-size integers for .idx file I/O
  Use fixed-size integers for the on-disk pack structure.
  git-format-patch: the default suffix is now .patch, not .txt
  git-format-patch: make --binary on by default
  Add --summary to git-format-patch by default
  git-format-patch -3
  Document pack .idx file format upgrade strategy.
  Refer users to git-rev-parse for revision specification syntax.
  Document the master@{n} reflog query syntax.
  Documentation/git-parse-remote.txt: we deal with config vars as well
  Documentation: m can be relative in "git-blame -Ln,m"
  Documentation: suggest corresponding Porcelain-level in plumbing docs.
  Documentation/git-resolve: deprecated.
2007-01-18 16:26:36 -08:00
Junio C Hamano
72fe6a5989 Documentation: Generate command lists.
This moves the source of the list of commands and categorization
to the end of Documentation/cmd-list.perl, so that re-categorization
and re-ordering would become easier to manage.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 16:18:29 -08:00
Junio C Hamano
c3f0baacad Documentation: sync git.txt command list and manual page title
Also reorders a handful entries to make each list sorted
alphabetically.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 15:53:37 -08:00
Junio C Hamano
377e81392f Documentation: move command list in git.txt into separate files.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 15:03:13 -08:00
Matthias Lederhofer
bd67f09f6d prune-packed: add -q to usage
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 14:30:05 -08:00
David Kågedal
cc75ad6762 Document --ignore-if-in-upstream in git-format-patch
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 14:29:42 -08:00
David Kågedal
a5cd09f993 Shell syntax fix in git-reset
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 14:22:24 -08:00
Simon 'corecode' Schubert
4700951298 Use standard -t option for touch.
Non-GNU touch do not have the -d option to take free form
date strings.  The POSIX -t option should be more widespread.
For this to work, date needs to output YYYYMMDDHHMM.SS date strings.

Signed-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 14:17:54 -08:00
Junio C Hamano
b18b00a661 Use fixed-size integers for .idx file I/O
This attempts to finish what Simon started in the previous commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 14:11:50 -08:00
Simon 'corecode' Schubert
bb79103194 Use fixed-size integers for the on-disk pack structure.
Plain integer types without a fixed size can vary between platforms.  Even
though all common platforms use 32-bit ints, there is no guarantee that
this won't change at some point.  Furthermore, specifying an integer type
with explicit size makes the definition of structures more obvious.

Signed-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-18 14:11:50 -08:00
Junio C Hamano
917a8f891f git-format-patch: the default suffix is now .patch, not .txt
Editors often give easier handling of patch files if the
filename ends with .patch, so use it instead of .txt.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 23:48:20 -08:00
Junio C Hamano
e47f306d4b git-format-patch: make --binary on by default
It does not make much sense to generate a patch that cannot be
applied.  If --text is specified on the command line it still
takes precedence.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 23:48:20 -08:00
Junio C Hamano
c261e4385e Add --summary to git-format-patch by default
This adds --summary output in addition to the --stat to the
output from git-format-patch by default.

I think additions, removals and filemode changes are rare but
notable events and always showing it makes sense.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 23:48:20 -08:00
Junio C Hamano
7c49628010 git-format-patch -3
This teaches "git-format-patch" to honor the --max-count
parameter revision traversal machinery takes, so that you can
say "git-format-patch -3" to process the three topmost commits
from the current HEAD (or "git-format-patch -2 topic" to name a
specific branch).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 23:48:20 -08:00
Shawn O. Pearce
df1b059d8d Document pack .idx file format upgrade strategy.
Way back when Junio developed the 64 bit index topic he came up
with a means of changing the .idx file format so that older Git
clients would recognize that they don't understand the file and
refuse to read it, while newer clients could tell the difference
between the old-style and new-style .idx files.  Unfortunately
this wasn't recorded anywhere.

This change documents how we might go about changing the .idx
file format by using a special signature in the first four bytes.
Credit (and possible blame) goes completely to Junio for thinking
up this technique.

The change also modifies the error message of the current Git code
so that users get a recommendation to upgrade their Git software
should this version or later encounter a new-style .idx which it
cannot process.  We already do this for the .pack files, but since
we usually process the .idx files first its important that these
files are recognized and encourage an upgrade.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 20:51:45 -08:00
Shawn O. Pearce
41a5564e05 Refer users to git-rev-parse for revision specification syntax.
The revision specification syntax (sometimes referred to as
SHA1-expressions) is accepted almost everywhere in Git by
almost every tool.  Unfortunately it is only documented in
git-rev-parse.txt, and most users don't know to look there.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 20:45:41 -08:00