Commit Graph

43697 Commits

Author SHA1 Message Date
Pat Thoyts
525934f9ab 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>
2013-12-29 19:18:04 -06:00
Pat Thoyts
0bed0789b7 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>
2013-12-29 19:18:04 -06:00
Karsten Blees
d8f462af12 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>
2013-12-29 19:18:04 -06:00
Pat Thoyts
c82f9f765f t4041: ensure the utf-8 encoded string really gets stored as utf-8.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-12-29 19:18:04 -06:00
Pat Thoyts
96f35b6188 t4205: use a file to ensure the encoding is as desired with msysgit
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-12-29 19:18:04 -06:00
Pat Thoyts
f0eb3aa6e3 t6006: be explicit about the encoding of test strings for msysgit
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-12-29 19:18:03 -06:00
Pat Thoyts
8c07e1ab83 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>
2013-12-29 19:18:03 -06:00
Pat Thoyts
cfcf421ea5 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>
2013-12-29 19:18:03 -06:00
Pat Thoyts
c84364e63d 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>
2013-12-29 19:18:03 -06:00
Pat Thoyts
d6a503cccb 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>
2013-12-29 19:18:03 -06:00
Johannes Schindelin
acb45b99ad Fix t3404 for Windows
The usual problem: CR/LF...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-29 19:18:03 -06:00
Pat Thoyts
bbf3821b4a t1306: perform file comparisons using text mode for Windows support
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-12-29 19:18:03 -06:00
Johannes Schindelin
579c21bb65 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>
2013-12-29 19:18:02 -06:00
Johannes Schindelin
a35f130b4d 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>
2013-12-29 19:18:02 -06:00
Karsten Blees
f8a16a6a84 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>
2013-12-29 19:18:02 -06:00
Johannes Schindelin
c475d43cf6 Introduce and use test_cmp_text
On Windows, we suffer from frequently leaked DOS line endings. Let's
ignore them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-29 19:18:02 -06:00
Johannes Schindelin
b672fbc703 Windows: make sure that merge-octopus only outputs LF line endings
This happens to shut up t7602 on Windows which would otherwise take
the different line endings for a sign that the merge failed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-29 19:18:02 -06:00
Sverre Rabbelier
58255dc987 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>
2013-12-29 19:18:02 -06:00
Johannes Schindelin
0ea01c407b t030[02]: work around CR/LF issue
It is the old shell-script issue we had in a few other tests already.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-29 19:18:02 -06:00
Pat Thoyts
285debf1b5 t5407: Fix line-ending dependency in post-rewrite.args
On msysGit creating the post-rewrite.args file using 'echo' has different
line endings from the expected comparison. Using perl normalizes the line
endings for each generated file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-12-29 19:18:01 -06:00
Pat Thoyts
c9422ecef1 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>
2013-12-29 19:18:01 -06:00
Johannes Schindelin
e62c425d4d MinGW: Skip test redirecting to fd 4
... because that does not work in MinGW.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-29 19:18:01 -06:00
Johannes Schindelin
cc12c4fbef Handle new t1501 test case properly with MinGW
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-29 19:18:01 -06:00
Heiko Voigt
74ef0f0d89 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>
2013-12-29 19:18:01 -06:00
Johannes Schindelin
7106473b3a Work around funny CR issue
This is really a problem with shell scripts being called on msysGit,
but there are more important bugs to fix for the moment.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-29 19:18:01 -06:00
Sebastian Schuberth
e840b56252 am: Use cat instead of echo to avoid DOS line-endings (fixes t4150)
Along the lines of 05d0e3b and f33946d, use cat instead of echo to avoid
line ending mismatches in the test result of "am empty-file does not
infloop" which make the test fail.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2013-12-29 19:18:00 -06:00
Sebastian Schuberth
1684f8eea5 submodule: Fix t7400, t7405, t7406 for msysGit
Again, avoid using echo (which issues DOS line endings on msysGit) to not mix
with Unix line-endings issued by git built-ins, even if this is at the cost of
calling an external executable (cat) instead of a shell built-in (echo).
2013-12-29 19:18:00 -06:00
Johannes Schindelin
ccf398bf3f Start the merging-rebase to v1.8.5.2
This commit starts the rebase of 04deb9e to b684000
2013-12-29 19:17:47 -06:00
Johannes Schindelin
5e4a59bb78 Merge 'unlimited-grafts' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
2ca0702d7e Merge 'poll-busy-wait' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
3b23ed706a Merge 'normalize-win-paths' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
2579131837 Merge 'msvc-link-crt' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
543d32434b Merge 'install-wincred' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
87aa0f06fd Merge 'fix-is-exe' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
7b42a55fe7 Merge 'fix-externals' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
3d87967789 Merge 'stash-reflog' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
09f648cd7c Merge 'http-msys-paths' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
a5b0843e5f 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>
2013-12-27 18:09:43 -06:00
Johannes Schindelin
38fd197d28 Merge 'win-tests-fixes' into HEAD 2013-12-27 18:09:42 -06:00
Johannes Schindelin
c149701fd4 Merge 'grep-fixes' into HEAD 2013-12-27 18:09:42 -06:00
Johannes Schindelin
d562b59a22 Merge 'pull-rebase-interactive' into HEAD 2013-12-27 18:09:42 -06:00
Johannes Schindelin
343fea4042 Teach 'git remote' that the config var branch.*.rebase can be 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 18:09:37 -06:00
Johannes Schindelin
9e62257790 Handle the branch.<name>.rebase value 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 18:09:37 -06:00
Johannes Schindelin
f557f6771d Teach 'git pull' to handle --rebase=interactive
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 18:09:37 -06:00
Johannes Schindelin
609484f9eb 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>
2013-12-27 18:02:54 -06:00
Brice Lambson
d1e14dd7b9 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>
2013-12-27 18:02:53 -06:00
Pat Thoyts
4eae745fcf 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>
2013-12-27 18:02:52 -06:00
Pat Thoyts
59a30f38a3 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>
2013-12-27 18:02:51 -06:00
Karsten Blees
2d52168a4b 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>
2013-12-27 18:02:50 -06:00
Johannes Schindelin
0b93eb3da7 Remove the line length limit for graft files
Support for grafts predates Git's strbuf, and hence it is understandable
that there was a hard-coded line length limit of 1023 characters (which
was chosen a bit awkwardly, given that it is *exactly* one byte short of
aligning with the 41 bytes occupied by a commit name and the following
space or new-line character).

While regular commit histories hardly win comprehensibility in general
if they merge more than twenty-two branches in one go, only a lack of
imagination could explain this unnecessary limitation for general use
cases: the grafts facility *was* introduced to override regular commit
histories.

In this particular developer's case, the use case that requires
substantially longer graft lines to be supported is the visualization of
the commits' order implied by their changes: commits are considered to
have an implicit relationship iff exchanging them in an interactive
rebase would result in merge conflicts.

Thusly implied branches tend to be very shallow in general, and the
resulting thicket of implied branches is usually very wide; It is
actually quite common that *most* of the commits in a topic branch have
not even one implied parents, so that a final merge commit has about as
many implied parents as there are commits in said branch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 10:18:36 -06:00