Commit Graph

44798 Commits

Author SHA1 Message Date
Johannes Schindelin
677413397c Merge 'normalize-win-paths' into HEAD 2014-04-10 13:53:45 -05:00
Johannes Schindelin
7ee44c5dfd Merge 'msvc-link-crt' into HEAD 2014-04-10 13:53:44 -05:00
Johannes Schindelin
5f6e8a9316 Merge 'install-wincred' into HEAD 2014-04-10 13:53:44 -05:00
Johannes Schindelin
5544bd1339 Merge 'fix-is-exe' into HEAD 2014-04-10 13:53:44 -05:00
Johannes Schindelin
108c844f57 Merge 'fix-externals' into HEAD 2014-04-10 13:53:44 -05:00
Johannes Schindelin
4034092fde Merge 'stash-reflog' into HEAD 2014-04-10 13:53:44 -05:00
Johannes Schindelin
9c90f99395 Merge 'http-msys-paths' into HEAD 2014-04-10 13:53:44 -05:00
Johannes Schindelin
746f6f41b7 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-04-10 13:53:43 -05:00
Johannes Schindelin
616c7ba9be Merge 'win-tests-fixes' into HEAD 2014-04-10 13:53:43 -05:00
Johannes Schindelin
85efa6f012 Merge 'grep-fixes' into HEAD 2014-04-10 13:53:43 -05:00
Johannes Schindelin
98cc090b7d Merge 'pull-rebase-interactive' into HEAD 2014-04-10 13:53:43 -05:00
Johannes Schindelin
94899e014a Merge 'send-email' into HEAD 2014-04-10 13:53:43 -05:00
Johannes Schindelin
7051c657c4 Merge 'jberezanski/wincred-sso-r2' into HEAD 2014-04-10 13:53:42 -05:00
Johannes Schindelin
d5fe20671a Merge 'gitweb-syntax' into HEAD 2014-04-10 13:53:42 -05:00
Johannes Schindelin
7e977b24e8 Merge 'gitk' into HEAD 2014-04-10 13:53:42 -05:00
Johannes Schindelin
2581b787a1 Merge 'git-gui' into HEAD 2014-04-10 13:53:42 -05:00
Johannes Schindelin
d10e8eccd6 Merge 'deny-current-branch' into HEAD 2014-04-10 13:53:42 -05:00
Johannes Schindelin
c808197015 Merge 'criss-cross-merge' into HEAD 2014-04-10 13:53:41 -05:00
Johannes Schindelin
dbda31249f Merge 'am-submodules' into HEAD 2014-04-10 13:53:41 -05:00
Johannes Schindelin
063e2dbf79 Merge 'unc' into HEAD 2014-04-10 13:53:41 -05:00
Johannes Schindelin
f4a12d6d73 Merge 'home' into HEAD 2014-04-10 13:53:41 -05:00
Johannes Schindelin
37f6f9eafc Merge 'hide-dotgit' into HEAD 2014-04-10 13:53:41 -05:00
Johannes Schindelin
58846d4909 Merge 'unicode' into HEAD 2014-04-10 13:53:41 -05:00
Heiko Voigt
f79024590a Windows: Always normalize paths to Windows-style
It appears that `pwd` returns the POSIX-style or the DOS-style path
depending which style the previous `cd` used. To normalize, enforce `pwd
-W` in scripts.

From the original e-mail exchange:

On Thu, Mar 22, 2012 at 11:13:37AM +0100, Sebastian Schuberth wrote:
> On Wed, Mar 21, 2012 at 22:21, Johannes Sixt <j6t@kdbg.org> wrote:
>
> > I build git and run its tests outside the msysgit environment. Does that
> > explain the difference? (And I use CMD.)
>
> It does not make a difference for me. I started cmd.exe at
> c:\msysgit\git\t, added c:\msysgit\bin temporarily to PATH, and ran
> "sh t5526-fetch-submodules.sh -i -v", and the test still fails.

Yes it probably does. Johannes said that he runs the tests outside of
the msysgit folder. That way there is only one path the submodule script
gets reported and not two like '/c/msysgit/git' and '/git'.

That would explain to me why it is passing.

I am afraid that the only solution is to patch msys itself to report the
long absolute path when passing window style paths to cd. Currently when
I do

	cd c:/msysgit/git

I will end up in '/git' instead of the long path.

I found that there is a -W option to pwd in msys bash which makes it
always return the real windows path. A normalization in that direction
is unique and thus might be more robust. Have a look at the attached
patch. With this at least t5526 passes. I was not able to run the whole
testsuite properly at the moment. I can have a look at that tomorrow.

What do you think?

Cheers Heiko

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-04-10 13:53:37 -05:00
Karsten Blees
0e54eea33e MSVC: link dynamically to the CRT
Dynamic linking is generally preferred over static linking, and MSVCRT.dll
has been integral part of Windows for a long time.

This also fixes linker warnings for _malloc and _free in zlib.lib, which
seems to be compiled for MSVCRT.dll already.

The DLL version also exports some of the CRT initialization functions,
which are hidden in the static libcmt.lib (e.g. __wgetmainargs, required by
subsequent Unicode patches).

Signed-off-by: Karsten Blees <blees@dcon.de>
2014-04-10 13:53:36 -05:00
Pat Thoyts
ae8281d888 wincred: add install target and avoid overwriting configured variables.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-04-10 13:53:36 -05:00
Heiko Voigt
f3f9ee9ea0 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-04-10 13:53:35 -05:00
Adam Roben
75036e7e9c 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-04-10 13:53:35 -05:00
Adam Roben
216ebe76f2 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-04-10 13:53:35 -05:00
Evgeny Pashkin
37a22b4c02 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-04-10 13:53:35 -05:00
Johannes Schindelin
688cf6e0aa git stash: make sure that .git/logs/refs/ exists
If the user has not activated reflogs, or if nothing has been recorded
yet (as is the case directly after cloning), said directory may not
exist yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-04-10 13:53:34 -05:00
Johannes Schindelin
c64a221e53 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-04-10 13:53:34 -05:00
Johannes Schindelin
a77f04ddf6 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-04-10 13:53:33 -05:00
Sverre Rabbelier
9e54e5234a 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-04-10 13:53:33 -05:00
Sverre Rabbelier
e1b8d093eb transport-helper: add trailing --
[PT: ensure we add an additional element to the argv array]
2014-04-10 13:53:33 -05:00
Johannes Schindelin
1888bd7f48 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-04-10 13:53:33 -05:00
Johannes Schindelin
da5160ac0b 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-04-10 13:53:32 -05:00
Brice Lambson
955e43dfa8 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-04-10 13:53:32 -05:00
Pat Thoyts
9f79ea3b0e Push the NATIVE_CRLF Makefile variable to C and added a test for native.
Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is
incorrectly set on Mingw git. However, the Makefile variable is not
propagated to the C preprocessor and results in no change. This patch
pushes the definition to the C code and adds a test to validate that
when core.eol as native is crlf, we actually normalize text files to this
line ending convention when core.autocrlf is false.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-04-10 13:53:32 -05:00
Pat Thoyts
9da68ecd8e 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-04-10 13:53:30 -05:00
Karsten Blees
0b45d85e80 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-04-10 13:53:30 -05:00
Pat Thoyts
701cc0b0e4 t4041: ensure the utf-8 encoded string really gets stored as utf-8.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-04-10 13:53:30 -05:00
Pat Thoyts
4de45ba540 t4205: use a file to ensure the encoding is as desired with msysgit
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-04-10 13:53:30 -05:00
Pat Thoyts
6d5ddafd37 t6006: be explicit about the encoding of test strings for msysgit
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-04-10 13:53:29 -05:00
Pat Thoyts
b5dde949bb t7102: do not assume the system encoding is utf-8
The commit_msg function has an assumption that the string is being output
as utf-8. On Windows this is not true so always convert from the system
encoding to the desired encoding.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-04-10 13:53:29 -05:00
Pat Thoyts
5c2060439b 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-04-10 13:53:29 -05:00
Pat Thoyts
d813621f8d t7800: a few tests should ignore crlf in checking the result.
Those tests that generate files using echo can expect crlf issues when run
under windows. For such cases we use 'test_cmp_text'.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-04-10 13:53:29 -05:00
Pat Thoyts
b530e4bf39 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-04-10 13:53:29 -05:00
Johannes Schindelin
4a70c2b0e3 Fix t3404 for Windows
The usual problem: CR/LF...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-04-10 13:53:29 -05:00
Pat Thoyts
b15d6dc168 t1306: perform file comparisons using text mode for Windows support
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-04-10 13:53:29 -05:00