Commit Graph

45168 Commits

Author SHA1 Message Date
Johannes Schindelin
0853bed367 Merge branch 'tag-contains'
This topic branch addresses out-of-memory errors in particular on
Windows, where the default stack space is not very large.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-10 16:57:03 -05:00
Johannes Schindelin
58af5a8889 Merge pull request #126 from RomanBelinsky/master
fix date parsing error:  Update SVN.pm
2014-05-10 16:57:02 -05:00
Johannes Schindelin
8947aba21a Merge pull request #115 from msysgit/tip4commit
Mention tip4commit
2014-05-10 16:57:02 -05:00
Johannes Schindelin
d774bfc142 Merge 'poll-busy-wait' into HEAD 2014-05-10 16:57:02 -05:00
Johannes Schindelin
43e098b1b2 Merge 'normalize-win-paths' into HEAD 2014-05-10 16:57:02 -05:00
Johannes Schindelin
8f9a5f39f3 Merge 'msvc-link-crt' into HEAD 2014-05-10 16:57:02 -05:00
Johannes Schindelin
a02dd25e70 Merge 'install-wincred' into HEAD 2014-05-10 16:57:02 -05:00
Johannes Schindelin
618f8140c9 Merge 'fix-is-exe' into HEAD 2014-05-10 16:57:01 -05:00
Johannes Schindelin
4af426c1e5 Merge 'fix-externals' into HEAD 2014-05-10 16:57:01 -05:00
Johannes Schindelin
e598900a99 Merge 'stash-reflog' into HEAD 2014-05-10 16:57:01 -05:00
Johannes Schindelin
7abda7a425 Merge 'http-msys-paths' into HEAD 2014-05-10 16:57:01 -05:00
Johannes Schindelin
b7593f867f 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-10 16:57:01 -05:00
Johannes Schindelin
acdd2fc2d3 Merge 'win-tests-fixes' into HEAD 2014-05-10 16:57:01 -05:00
Johannes Schindelin
cbdee028b8 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-10 16:57:00 -05:00
Johannes Schindelin
5a9b30853b Merge 'grep-fixes' into HEAD 2014-05-10 16:57:00 -05:00
Johannes Schindelin
5322eac747 Merge 'pull-rebase-interactive' into HEAD 2014-05-10 16:57:00 -05:00
Johannes Schindelin
ab62c69232 Merge 'send-email' into HEAD 2014-05-10 16:57:00 -05:00
Johannes Schindelin
2398365930 Merge 'jberezanski/wincred-sso-r2' into HEAD 2014-05-10 16:57:00 -05:00
Johannes Schindelin
66353333a0 Merge 'gitweb-syntax' into HEAD 2014-05-10 16:56:59 -05:00
Johannes Schindelin
48e63552e6 Merge 'gitk' into HEAD 2014-05-10 16:56:59 -05:00
Johannes Schindelin
790f423a13 Merge 'git-gui' into HEAD 2014-05-10 16:56:59 -05:00
Johannes Schindelin
9a1e8b50f4 Merge 'deny-current-branch' into HEAD 2014-05-10 16:56:59 -05:00
Johannes Schindelin
7536fcf23d Merge 'criss-cross-merge' into HEAD 2014-05-10 16:56:59 -05:00
Johannes Schindelin
be6b605193 Merge 'am-submodules' into HEAD 2014-05-10 16:56:59 -05:00
Johannes Schindelin
9485bf31d5 Merge 'unc' into HEAD 2014-05-10 16:56:58 -05:00
Johannes Schindelin
a565692e8c Merge 'home' into HEAD 2014-05-10 16:56:58 -05:00
Johannes Schindelin
16180e48a2 Merge 'hide-dotgit' into HEAD 2014-05-10 16:56:58 -05:00
Johannes Schindelin
547db2e8c8 Merge 'unicode' into HEAD 2014-05-10 16:56:58 -05:00
Johannes Schindelin
cec0b8ed6f Touch up the comments in the 'tag-contains' branch
Thomas Braun pointed out several documentation shortcomings.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-10 16:56:55 -05:00
Jean-Jacques Lafay
f172da6b28 git tag --contains : avoid stack overflow
In large repos, the recursion implementation of contains(commit,
commit_list) may result in a stack overflow. Replace the recursion with
a loop to fix it.

This problem is more apparent on Windows than on Linux, where the stack
is more limited by default.

See also this thread on the msysGit list:

	https://groups.google.com/d/topic/msysgit/FqT6boJrb2g/discussion

[jes: re-written to imitate the original recursion more closely]

Signed-off-by: Jean-Jacques Lafay <jeanjacques.lafay@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Tested-by: Stepan Kasal <kasal@ucw.cz>
2014-05-10 16:56:49 -05:00
RomanBelinsky
e2ffc77010 Update SVN.pm
fix parsing error for dates like:
2014-01-07T5:58:36.048176Z
previous regex can parse only:
2014-01-07T05:58:36.048176Z
reproduced in my svn repository during conversion.
2014-05-10 16:56:48 -05:00
Johannes Schindelin
c70bf30377 Add a README.md
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-10 16:56:48 -05:00
theoleblond
d82d0d2602 Sleep 1 millisecond in poll() to avoid busy wait
I played around with this quite a bit. After trying some more complex
schemes, I found that what worked best is to just sleep 1 millisecond
between iterations. Though it's a very short time, it still completely
eliminates the busy wait condition, without hurting perf.

There code uses SleepEx(1, TRUE) to sleep. See this page for a good
discussion of why that is better than calling SwitchToThread, which
is what was used previously:
http://stackoverflow.com/questions/1383943/switchtothread-vs-sleep1

Note that calling SleepEx(0, TRUE) does *not* solve the busy wait.

The most striking case was when testing on a UNC share with a large repo,
on a single CPU machine. Without the fix, it took 4 minutes 15 seconds,
and with the fix it took just 1:08! I think it's because git-upload-pack's
busy wait was eating the CPU away from the git process that's doing the
real work. With multi-proc, the timing is not much different, but tons of
CPU time is still wasted, which can be a killer on a server that needs to
do bunch of other things.

I also tested the very fast local case, and didn't see any measurable
difference. On a big repo with 4500 files, the upload-pack took about 2
seconds with and without the fix.
2014-05-10 16:56:47 -05:00
Heiko Voigt
9e9b802290 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-05-10 16:56:47 -05:00
Karsten Blees
ff9fa75486 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-05-10 16:56:47 -05:00
Pat Thoyts
bc6bd8eceb wincred: add install target and avoid overwriting configured variables.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-05-10 16:56:46 -05:00
Heiko Voigt
66927169c0 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-10 16:56:46 -05:00
Adam Roben
c1c634b361 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-10 16:56:45 -05:00
Adam Roben
ecb9eff987 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-10 16:56:45 -05:00
Evgeny Pashkin
ad1e2f08fc 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-10 16:56:45 -05:00
Johannes Schindelin
c34e9ff1df 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-05-10 16:56:44 -05:00
Johannes Schindelin
57c8e5cd88 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-10 16:56:44 -05:00
Johannes Schindelin
fe9aab204b 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-10 16:56:44 -05:00
Sverre Rabbelier
11b6018de6 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-10 16:56:44 -05:00
Pat Thoyts
ef4a733c08 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-10 16:56:43 -05:00
Sverre Rabbelier
5e40ceb57c transport-helper: add trailing --
[PT: ensure we add an additional element to the argv array]
2014-05-10 16:56:43 -05:00
Johannes Schindelin
986d2d4ee6 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-10 16:56:43 -05:00
Johannes Schindelin
12480d0026 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-10 16:56:43 -05:00
Pat Thoyts
a0c3e15ddd 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-10 16:56:43 -05:00
Karsten Blees
92e324a74e 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-10 16:56:42 -05:00