Commit Graph

46041 Commits

Author SHA1 Message Date
Stepan Kasal
0346eed1fe Merge pull request #181 from kasal/tests-no-posix
Revert "test: fix t7001 cp to use POSIX options"
2014-05-29 11:09:35 +02:00
Stepan Kasal
81065695fa Merge remote-tracking branch 't-b/sideband-bug'
This will allow us to work around the push issues pointed out in
https://github.com/msysgit/git/issues/101.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 11:09:33 +02:00
Stepan Kasal
8dd46ca5c6 Merge pull request #115 from msysgit/tip4commit
Mention tip4commit
2014-05-29 11:09:32 +02:00
Stepan Kasal
e98b901a56 Merge 'fix-is-exe' into HEAD 2014-05-29 11:09:31 +02:00
Stepan Kasal
eea0cd30b9 Merge 'fix-externals' into HEAD 2014-05-29 11:09:29 +02:00
Stepan Kasal
d7f09b8796 Merge 'http-msys-paths' into HEAD 2014-05-29 11:09:28 +02:00
Stepan Kasal
22f90c0851 Merge 'remote-hg-prerequisites' into HEAD
These fixes were necessary for Sverre Rabbelier's remote-hg to work,
but for some magic reason they are not necessary for the current
remote-hg. Makes you wonder how that one gets away with it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 11:09:26 +02:00
Stepan Kasal
d9608ecaa2 Merge 'win-tests-fixes' into HEAD 2014-05-29 11:09:25 +02:00
Stepan Kasal
5fc80b71bb Merge branch 'some-CR-fixes'
This branch contains some hacks so that Git produces less CR, and then
some tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 11:09:24 +02:00
Stepan Kasal
8746a0e5f3 Merge 'pull-rebase-interactive' into HEAD 2014-05-29 11:09:22 +02:00
Stepan Kasal
cd247ada61 Merge 'send-email' into HEAD 2014-05-29 11:09:21 +02:00
Stepan Kasal
9dd0c91441 Merge 'jberezanski/wincred-sso-r2' into HEAD 2014-05-29 11:09:19 +02:00
Stepan Kasal
146e000abe Merge 'gitweb-syntax' into HEAD 2014-05-29 11:09:18 +02:00
Stepan Kasal
83d825b573 Merge 'gitk' into HEAD 2014-05-29 11:09:16 +02:00
Stepan Kasal
900f993cb1 Merge 'git-gui' into HEAD 2014-05-29 11:09:15 +02:00
Stepan Kasal
32143d9161 Merge 'deny-current-branch' into HEAD 2014-05-29 11:09:14 +02:00
Stepan Kasal
fb0f5d14bc Merge 'criss-cross-merge' into HEAD 2014-05-29 11:09:12 +02:00
Stepan Kasal
82c8da7c74 Merge 'am-submodules' into HEAD 2014-05-29 11:09:11 +02:00
Stepan Kasal
2e69421a65 Merge 'home' into HEAD 2014-05-29 11:08:05 +02:00
Stepan Kasal
9e8817c4d0 Merge 'hide-dotgit' into HEAD 2014-05-29 10:58:53 +02:00
Stepan Kasal
dc63934ed3 Merge 'unicode' into HEAD 2014-05-29 10:58:25 +02:00
Stepan Kasal
6ac4a73cc8 Merge 'refs/rewritten/junio/notyet' into HEAD 2014-05-29 10:55:42 +02:00
Stepan Kasal
674dd13590 Merge 'refs/rewritten/junio/next' into HEAD 2014-05-29 10:55:41 +02:00
Stepan Kasal
6d3e23d45c Revert "test: fix t7001 cp to use POSIX options"
This reverts commit 00764ca1, as our ancient version of "cp" has
problems about the "new" POSIX option "-P" (yields exit code 1).
2014-05-29 10:42:27 +02:00
Thomas Braun
9f0af82932 Config option to disable side-band-64k for transport
Since commit 0c499ea60f the send-pack builtin uses the side-band-64k
capability if advertised by the server.

Unfortunately this breaks pushing over the dump git protocol if used
over a network connection.

The detailed reasons for this breakage are (by courtesy of Jeff Preshing,
quoted from ttps://groups.google.com/d/msg/msysgit/at8D7J-h7mw/eaLujILGUWoJ):
----------------------------------------------------------------------------
MinGW wraps Windows sockets in CRT file descriptors in order to mimic the
functionality of POSIX sockets. This causes msvcrt.dll to treat sockets as
Installable File System (IFS) handles, calling ReadFile, WriteFile,
DuplicateHandle and CloseHandle on them. This approach works well in simple
cases on recent versions of Windows, but does not support all usage patterns.
In particular, using this approach, any attempt to read & write concurrently
on the same socket (from one or more processes) will deadlock in a scenario
where the read waits for a response from the server which is only invoked after
the write. This is what send_pack currently attempts to do in the use_sideband
codepath.
----------------------------------------------------------------------------

The new config option "sendpack.sideband" allows to override the side-band-64k
capability of the server, and thus makes the dump git protocol work.

Other transportation methods like ssh and http/https still benefit from
the sideband channel, therefore the default value of "sendpack.sideband"
is still true.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
2014-05-29 10:42:22 +02:00
Johannes Schindelin
705b6ee33f Add a README.md
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:42:19 +02:00
Heiko Voigt
a1d1b7120e help: correct behavior for is_executable on Windows
The previous implementation said that the filesystem information on
Windows is not reliable to determine whether a file is executable.
To find gather this information it was peeking into the first two bytes
of a file to see whether it looks executable.
Apart from the fact that on Windows executables are usually defined as
such by their extension it lead to slow opening of help file in some
situations.

When you have virus scanner running calling open on an executable file
is a potentially expensive operation. See the following measurements (in
seconds) for example.

With virus scanner running (coldcache):

$ ./a.exe /libexec/git-core/
before open (git-add.exe): 0.000000
after open (git-add.exe): 0.412873
before open (git-annotate.exe): 0.000175
after open (git-annotate.exe): 0.397925
before open (git-apply.exe): 0.000243
after open (git-apply.exe): 0.399996
before open (git-archive.exe): 0.000147
after open (git-archive.exe): 0.397783
before open (git-bisect--helper.exe): 0.000160
after open (git-bisect--helper.exe): 0.397700
before open (git-blame.exe): 0.000160
after open (git-blame.exe): 0.399136
...

With virus scanner running (hotcache):

$ ./a.exe /libexec/git-core/
before open (git-add.exe): 0.000000
after open (git-add.exe): 0.000325
before open (git-annotate.exe): 0.000229
after open (git-annotate.exe): 0.000177
before open (git-apply.exe): 0.000167
after open (git-apply.exe): 0.000150
before open (git-archive.exe): 0.000154
after open (git-archive.exe): 0.000156
before open (git-bisect--helper.exe): 0.000132
after open (git-bisect--helper.exe): 0.000180
before open (git-blame.exe): 0.000718
after open (git-blame.exe): 0.000724
...

This test did just list the given directory and open() each file in it.

With this patch I get:

$ time git help git
Launching default browser to display HTML ...

real    0m8.723s
user    0m0.000s
sys     0m0.000s

and without

$ time git help git
Launching default browser to display HTML ...

real    1m37.734s
user    0m0.000s
sys     0m0.031s

both tests with cold cache and giving the machine some time to settle
down after restart.

Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
2014-05-29 10:42:15 +02:00
Adam Roben
1b8301f0fa Make non-.exe externals work again
7ebac8cb94 made launching of .exe
externals work when installed in Unicode paths. But it broke launching
of non-.exe externals, no matter where they were installed. We now
correctly maintain the UTF-8 and UTF-16 paths in tandem in lookup_prog.

This fixes t5526, among others.

Signed-off-by: Adam Roben <adam@roben.org>
2014-05-29 10:42:11 +02:00
Adam Roben
7ed7c525db Fix launching of externals from Unicode paths
If Git were installed in a path containing non-ASCII characters,
commands such as git-am and git-submodule, which are implemented as
externals, would fail to launch with the following error:

> fatal: 'am' appears to be a git command, but we were not
> able to execute it. Maybe git-am is broken?

This was due to lookup_prog not being Unicode-aware. It was somehow
missed in 2ee5a1a14a.

Note that the only problem in this function was calling
GetFileAttributes instead of GetFileAttributesW. The calls to access()
were fine because access() is a macro which resolves to mingw_access,
which already handles Unicode correctly. But I changed lookup_prog to
use _waccess directly so that we only convert the path to UTF-16 once.

Signed-off-by: Adam Roben <adam@roben.org>
2014-05-29 10:42:10 +02:00
Evgeny Pashkin
5868bd1869 Fixed wrong path delimiter in exe finding
On Windows XP3 in git bash
git clone git@github.com:octocat/Spoon-Knife.git
cd Spoon-Knife
git gui
menu Remote\Fetch from\origin
error: cannot spawn git: No such file or directory
error: could not run rev-list

if u run
git fetch --all
it worked normal in git bash or gitgui tools

In second version CreateProcess get 'C:\Git\libexec\git-core/git.exe' in
first version - C:/Git/libexec/git-core/git.exe and not executes (unix
slashes)

after fixing C:\Git\libexec\git-core\git.exe or
C:/Git/libexec/git-core\git.exe it works normal

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:42:09 +02:00
Johannes Schindelin
b14ce6effd Handle http.* config variables pointing to files gracefully on Windows
On Windows, we would like to be able to have a default http.sslCAinfo
that points to an MSys path (i.e. relative to the installation root of
Git).  As Git is a MinGW program, it has to handle the conversion
of the MSys path into a MinGW32 path itself.

Since system_path() considers paths starting with '/' as absolute, we
have to convince it to make a Windows path by stripping the leading
slash.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:42:05 +02:00
Johannes Schindelin
635328c5b0 Always auto-gc after calling a fast-import transport
After importing anything with fast-import, we should always let the
garbage collector do its job, since the objects are written to disk
inefficiently.

This brings down an initial import of http://selenic.com/hg from about
230 megabytes to about 14.

In the future, we may want to make this configurable on a per-remote
basis, or maybe teach fast-import about it in the first place.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:42:01 +02:00
Sverre Rabbelier
e32da277db remote-helper: check helper status after import/export
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2014-05-29 10:42:00 +02:00
Sverre Rabbelier
df8dfa30fe transport-helper: add trailing --
[PT: ensure we add an additional element to the argv array]
2014-05-29 10:41:59 +02:00
Johannes Schindelin
b1a3988796 fast-export: do not refer to non-existing marks
When calling `git fast-export a..a b` when a and b refer to the same
commit, nothing would be exported, and an incorrect reset line would
be printed for b ('from :0').

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2014-05-29 10:41:58 +02:00
Pat Thoyts
1ad487cf5b tests: do not pass iso8859-1 encoded parameter
git commit -m with some iso8859-1 encoded stuff is doomed to fail in MinGW,
because Windows don't let you pass encoded bytes to a process (CreateProcessW
always takes a UTF-16LE encoded string).

It is safe to pass the iso8859-1 message using a file or a pipe.

Thanks-to: Karsten Blees <blees@dcon.de>
Author: Stepan Kasal <kasal@ucw.cz>
2014-05-29 10:41:54 +02:00
Johannes Schindelin
5b682f1af8 Disable t0110's high-bit test on Windows
The bash Git for Windows uses (i.e. the MSys bash) cannot pass
command-line arguments with high bits set verbatim to non-MSys programs,
but instead converts those characters with high bits set to their hex
representation.

For example, when running

	strings "$(echo -e '\x80')"

(where strings.exe is a MinGW program, not an MSys one) it will complain
about not finding the file called "80".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:53 +02:00
Pat Thoyts
0ece80f0ca t9902: mingw-specific fix for gitfile link files
The path in a .git platform independent link file needs to be absolute
and under mingw we need it to be a windows type path, not a unix style
path so it should start with a drive letter and not a /.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-05-29 10:41:52 +02:00
Karsten Blees
e4aba7b46b t800[12]: work around MSys limitation
MSys works very hard to convert Unix-style paths into DOS-style ones.
*Very* hard.

So hard, indeed, that

	git blame -L/hello/,/green/

is translated into something like

	git blame -LC:/msysgit/hello/,C:/msysgit/green/

As seen in msys_p2w in src\msys\msys\rt\src\winsup\cygwin\path.cc, line
3204ff:

	case '-':
	  //
	  // here we check for POSIX paths as attributes to a POSIX switch.
	  //
	...

seemingly absolute POSIX paths in single-letter options get expanded by
msys.dll unless they contain '=' or ';'.

So a quick and very dirty fix is to use '-L/;*evil/'. (Using an equal sign
works only when it is before a comma, so in the above example, /=*green/
would still be converted to a DOS-style path.)

Commit-message-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:51 +02:00
Pat Thoyts
566b373f0d t4210: skip command-line encoding tests on mingw
On Windows the application command line is provided as unicode and in
mingw-git we convert that to utf-8. So these tests that require a iso-8859-1
input are being subverted by the encoding transformations we perform and
should be skipped.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-05-29 10:41:50 +02:00
Pat Thoyts
9f3afbc3f6 t0008: avoid absolute path on Windows as colon is used in the tests
The test separator char is a colon which means any absolute paths on windows
confuse the tests that use global_excludes.

Suggested-by: Karsten Blees <karsten.blees@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-05-29 10:41:49 +02:00
Johannes Schindelin
e2e62cef29 Work around a problem identified by BuildHive
Apparently the signal handling is not quite correct in the fsckobject
handling (most likely we rely on a side effect that lets us still output
some message after receiving a signal 13 but in the BuildHive setup this
fails intermittently).

As a consequence, the push in t5504 does fail as expected, but fails to
output anything (unexpected). Since this is good enough for now, let's
handle an empty output as success, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:47 +02:00
Johannes Schindelin
0a8629c67e t1050: Fix invalid call to dd(1)
This is a companion patch to fce52b4(t4012: Fix invalid call to dd(1)).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:46 +02:00
Karsten Blees
0c28f80718 MinGW: disable legacy encoding tests
On Windows, all native APIs are Unicode-based. It is impossible to pass
legacy encoded byte arrays to a process via command line or environment
variables. Disable the tests that try to do so.

In t3901, most tests still work if we don't mess up the repository encoding
in setup, so don't switch to ISO-8859-1 on MinGW.

Note that i18n tests that do their encoding tricks via encoded files (such
as t3900) are not affected by this.

Signed-off-by: Karsten Blees <blees@dcon.de>
2014-05-29 10:41:45 +02:00
Sverre Rabbelier
480cd59191 t9350: point out that refs are not updated correctly
This happens only when the corresponding commits are not exported in
the current fast-export run. This can happen either when the relevant
commit is already marked, or when the commit is explicitly marked
as UNINTERESTING with a negative ref by another argument.

This breaks fast-export basec remote helpers.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2014-05-29 10:41:44 +02:00
Pat Thoyts
6b1282f454 t3102: Windows filesystems may not use a literal asterisk in filenames.
Exclude these tests when using MINGW.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-05-29 10:41:43 +02:00
Johannes Schindelin
f7af2048c2 MinGW: Skip test redirecting to fd 4
... because that does not work in MinGW.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:42 +02:00
Johannes Schindelin
79bf6bd1b1 Handle new t1501 test case properly with MinGW
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:41 +02:00
Heiko Voigt
230d511579 work around misdetection of stdin attached to a tty
Git on Windows was made aware of the fact that sometimes a file may be
used by another process and so an operation may fail but the user might
be able to fix it and is asking for confirmation whether it should
retry.

This is implemented in a way that git only asks in case stdin and stderr
are attached to a tty. Unfortunately this seems to be misdetected
sometimes causing the testsuite to hang when git is waiting for a user
answer.

This patch works around the situation.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2014-05-29 10:41:40 +02:00
Brice Lambson
b1d0764958 MinGW: Update tests to handle a native eol of crlf
Some of the tests were written with the assumption that the native eol would
always be lf. After defining NATIVE_CRLF on MinGW, these tests began failing.
This change will update the tests to also handle a native eol of crlf.

Signed-off-by: Brice Lambson <bricelam@live.com>
2014-05-29 10:41:36 +02:00