All of lore.kernel.org
 help / color / mirror / Atom feed
* Topic sk/mingw-unicode-spawn-args breaks tests
@ 2014-07-10 20:05 Johannes Sixt
  2014-07-11 19:49 ` Karsten Blees
  0 siblings, 1 reply; 46+ messages in thread
From: Johannes Sixt @ 2014-07-10 20:05 UTC (permalink / raw)
  To: Karsten Blees; +Cc: Stepan Kasal, Git Mailing List, msysGit

It looks like I totally missed the topic sk/mingw-unicode-spawn-args.
Now it's in master, and it breaks lots of test cases for me:

t0050-filesystem
t0110-urlmatch-normalization
t4014-format-patch
t4041-diff-submodule-option
t4120-apply-popt
t4201-shortlog
t4205-log-pretty-formats
t4209-log-pickaxe
t4210-log-i18n
(I killed the test run here)

Am I doing something wrong? Does the topic depend on a particular
version of MSYS (or DLL)?

-- Hannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: Topic sk/mingw-unicode-spawn-args breaks tests
  2014-07-10 20:05 Topic sk/mingw-unicode-spawn-args breaks tests Johannes Sixt
@ 2014-07-11 19:49 ` Karsten Blees
  2014-07-12  7:50   ` Stepan Kasal
  0 siblings, 1 reply; 46+ messages in thread
From: Karsten Blees @ 2014-07-11 19:49 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Stepan Kasal, Git Mailing List, msysGit

Am 10.07.2014 22:05, schrieb Johannes Sixt:
> It looks like I totally missed the topic sk/mingw-unicode-spawn-args.
> Now it's in master, and it breaks lots of test cases for me:
> 
> t0050-filesystem
> t0110-urlmatch-normalization
> t4014-format-patch
> t4041-diff-submodule-option
> t4120-apply-popt
> t4201-shortlog
> t4205-log-pretty-formats
> t4209-log-pickaxe
> t4210-log-i18n
> (I killed the test run here)
> 
> Am I doing something wrong? Does the topic depend on a particular
> version of MSYS (or DLL)?
> 
> -- Hannes
> 

After commenting out fchmod in config.c, I get similar results.

At first glance, t0050 seems to fail because the unicode file
name patches are still missing.

t4041 tries to pass ISO-8859-1 encoded bytes on the command line,
which simply doesn't work on Windows (all OS APIs 'talk' UTF-16).
We have a fix for this in the msysgit fork [1] (but unfortunately
in another branch, so Stepan couldn't know the patch is related).

I suspect the other failures also fall in these two categories.

[1] https://github.com/msysgit/git/commit/ef4a733c

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: Topic sk/mingw-unicode-spawn-args breaks tests
  2014-07-11 19:49 ` Karsten Blees
@ 2014-07-12  7:50   ` Stepan Kasal
  2014-07-15  0:21     ` Johannes Schindelin
  2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
  0 siblings, 2 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-12  7:50 UTC (permalink / raw)
  To: Karsten Blees; +Cc: Johannes Sixt, Git Mailing List, msysGit

Hello Hannes,

> Am 10.07.2014 22:05, schrieb Johannes Sixt:
> > It looks like I totally missed the topic sk/mingw-unicode-spawn-args.
...
> > Am I doing something wrong? Does the topic depend on a particular
> > version of MSYS (or DLL)?

unfortunately, I paused my submissions at random point.

I'm sorry for breaking your setup.  I was not aware there is any
working Windows setup beyond msysGit.  Thus I did not object when the
half-done work was going to be moved ot master.

I'll try to submit the patches needed so that your setup works again.

Karsten writes:
> At first glance, t0050 seems to fail because the unicode file
> name patches are still missing.

Indeed, this is a pair of patches on the tip of my queue.

> t4041 tries to pass ISO-8859-1 encoded bytes on the command line,
> which simply doesn't work on Windows (all OS APIs 'talk' UTF-16).
> We have a fix for this in the msysgit fork [1] (but unfortunately
> in another branch, so Stepan couldn't know the patch is related).

There is a whole branch named win-tests or some such.  I remember I
was hunting for not-yet resolved instances of this bug.  This
convinced me that the test suite of vanilla git cannot work on
Windows.  I was not aware about the fact that this problem was masked
in the versions before Karsten's unicode patches.

Hannes, I'd like to submit the patches mentioned here during the
following week and I'd be glad to hear from you.

Stepan

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: Re: Topic sk/mingw-unicode-spawn-args breaks tests
  2014-07-12  7:50   ` Stepan Kasal
@ 2014-07-15  0:21     ` Johannes Schindelin
  2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
  1 sibling, 0 replies; 46+ messages in thread
From: Johannes Schindelin @ 2014-07-15  0:21 UTC (permalink / raw)
  To: Stepan Kasal; +Cc: Karsten Blees, Johannes Sixt, Git Mailing List, msysGit

Hi Stepan,

On Sat, 12 Jul 2014, Stepan Kasal wrote:

> > Am 10.07.2014 22:05, schrieb Johannes Sixt:
> > > It looks like I totally missed the topic sk/mingw-unicode-spawn-args.
> ...
> > > Am I doing something wrong? Does the topic depend on a particular
> > > version of MSYS (or DLL)?
> 
> unfortunately, I paused my submissions at random point.

;-)

> I'm sorry for breaking your setup.  I was not aware there is any
> working Windows setup beyond msysGit.

There is one other, very notable development environment relevant to Git
for Windows: https://github.com/sschuberth/mingwGitDevEnv. It is slated to
be the development environment to produce Git for Windows starting with
version 2.0.0.

I have pretty concrete plans to work on that switch, which will most
likely also affect Hannes (who has so far successfully resisted to develop
Git using the msysGit environment).

Those plans to step up my efforts regarding Git for Windows imply my
spending more time on the project again, subject to a couple of things
that are still being hashed out.

Stay tuned,
Dscho

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH 0/3] fix test suite with mingw-unicode patches
  2014-07-12  7:50   ` Stepan Kasal
  2014-07-15  0:21     ` Johannes Schindelin
@ 2014-07-15 13:43     ` Stepan Kasal
  2014-07-15 13:43       ` [PATCH 1/3] Win32: Unicode file name support (except dirent) Stepan Kasal
                         ` (4 more replies)
  1 sibling, 5 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-15 13:43 UTC (permalink / raw)
  To: Karsten Blees, Johannes Sixt; +Cc: GIT Mailing-list, msysGit, Stepan Kasal

Hello Hannes,
attached please find the patches that Karsten pointed out:

1) The unicode file name support was omitted from his unicode patch
series; my mistake, sorry.  There is still big part missing: support
for unicode environment; I can only hope the tests would choke on
that.

2) Windows cannot pass non-UTF parameters (commit messages in this
case): original patch by Pat Thoyts was extended to apply to other
similar cases: the commit msg is passed through stdin.

If there are still problems remaining, please tell us.

Thanks,
	Stepan

Karsten Blees (2):
  Win32: Unicode file name support (except dirent)
  Win32: Unicode file name support (dirent)

Pat Thoyts and Stepan Kasal(1):
  tests: do not pass iso8859-1 encoded parameter

 compat/mingw.c                   | 198 +++++++++++++++++++++++++++++----------
 compat/mingw.h                   |  18 +++-
 compat/win32/dirent.c            |  30 ++----
 compat/win32/dirent.h            |   2 +-
 t/t4041-diff-submodule-option.sh |   6 +-
 t/t4205-log-pretty-formats.sh    |   2 +-
 t/t6006-rev-list-format.sh       |   4 +-
 t/t7102-reset.sh                 |   8 +-
 8 files changed, 184 insertions(+), 84 deletions(-)

-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH 1/3] Win32: Unicode file name support (except dirent)
  2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
@ 2014-07-15 13:43       ` Stepan Kasal
  2014-07-15 13:43       ` [PATCH 2/3] Win32: Unicode file name support (dirent) Stepan Kasal
                         ` (3 subsequent siblings)
  4 siblings, 0 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-15 13:43 UTC (permalink / raw)
  To: Karsten Blees, Johannes Sixt
  Cc: GIT Mailing-list, msysGit, Karsten Blees, Stepan Kasal

From: Karsten Blees <blees@dcon.de>
Date: Thu, 15 Mar 2012 18:21:28 +0100

Replaces Windows "ANSI" APIs dealing with file- or path names with their
Unicode equivalent, adding UTF-8/UTF-16LE conversion as necessary.

The dirent API (opendir/readdir/closedir) is updated in a separate commit.

Adds trivial wrappers for access, chmod and chdir.

Adds wrapper for mktemp (needed for both mkstemp and mkdtemp).

The simplest way to convert a repository with legacy-encoded (e.g. Cp1252)
file names to UTF-8 ist to checkout with an old msysgit version and
"git add --all & git commit" with the new version.

Includes a fix for bug reported by John Chen:
On Windows XP (not Win7), directories cannot be deleted while a find handle
is open, causing "Deletion of directory '...' failed. Should I try again?"
prompts.

Prior to this commit, these failures were silently ignored due to
strbuf_free in is_dir_empty resetting GetLastError to ERROR_SUCCESS.

Close the find handle in is_dir_empty so that git doesn't block deletion
of the directory even after all other applications have released it.

Reported-by: John Chen <john0312@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 compat/mingw.c | 198 ++++++++++++++++++++++++++++++++++++++++++---------------
 compat/mingw.h |  18 ++++--
 2 files changed, 160 insertions(+), 56 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index 3baaa4d..c19e3d9 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1,6 +1,7 @@
 #include "../git-compat-util.h"
 #include "win32.h"
 #include <conio.h>
+#include <wchar.h>
 #include "../strbuf.h"
 #include "../run-command.h"
 
@@ -198,14 +199,16 @@ static int ask_yes_no_if_possible(const char *format, ...)
 	}
 }
 
-#undef unlink
 int mingw_unlink(const char *pathname)
 {
 	int ret, tries = 0;
+	wchar_t wpathname[MAX_PATH];
+	if (xutftowcs_path(wpathname, pathname) < 0)
+		return -1;
 
 	/* read-only files cannot be removed */
-	chmod(pathname, 0666);
-	while ((ret = unlink(pathname)) == -1 && tries < ARRAY_SIZE(delay)) {
+	_wchmod(wpathname, 0666);
+	while ((ret = _wunlink(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {
 		if (!is_file_in_use_error(GetLastError()))
 			break;
 		/*
@@ -221,45 +224,45 @@ int mingw_unlink(const char *pathname)
 	while (ret == -1 && is_file_in_use_error(GetLastError()) &&
 	       ask_yes_no_if_possible("Unlink of file '%s' failed. "
 			"Should I try again?", pathname))
-	       ret = unlink(pathname);
+	       ret = _wunlink(wpathname);
 	return ret;
 }
 
-static int is_dir_empty(const char *path)
+static int is_dir_empty(const wchar_t *wpath)
 {
-	struct strbuf buf = STRBUF_INIT;
-	WIN32_FIND_DATAA findbuf;
+	WIN32_FIND_DATAW findbuf;
 	HANDLE handle;
-
-	strbuf_addf(&buf, "%s\\*", path);
-	handle = FindFirstFileA(buf.buf, &findbuf);
-	if (handle == INVALID_HANDLE_VALUE) {
-		strbuf_release(&buf);
+	wchar_t wbuf[MAX_PATH + 2];
+	wcscpy(wbuf, wpath);
+	wcscat(wbuf, L"\\*");
+	handle = FindFirstFileW(wbuf, &findbuf);
+	if (handle == INVALID_HANDLE_VALUE)
 		return GetLastError() == ERROR_NO_MORE_FILES;
-	}
 
-	while (!strcmp(findbuf.cFileName, ".") ||
-			!strcmp(findbuf.cFileName, ".."))
-		if (!FindNextFile(handle, &findbuf)) {
-			strbuf_release(&buf);
-			return GetLastError() == ERROR_NO_MORE_FILES;
+	while (!wcscmp(findbuf.cFileName, L".") ||
+			!wcscmp(findbuf.cFileName, L".."))
+		if (!FindNextFileW(handle, &findbuf)) {
+			DWORD err = GetLastError();
+			FindClose(handle);
+			return err == ERROR_NO_MORE_FILES;
 		}
 	FindClose(handle);
-	strbuf_release(&buf);
 	return 0;
 }
 
-#undef rmdir
 int mingw_rmdir(const char *pathname)
 {
 	int ret, tries = 0;
+	wchar_t wpathname[MAX_PATH];
+	if (xutftowcs_path(wpathname, pathname) < 0)
+		return -1;
 
-	while ((ret = rmdir(pathname)) == -1 && tries < ARRAY_SIZE(delay)) {
+	while ((ret = _wrmdir(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {
 		if (!is_file_in_use_error(GetLastError()))
 			errno = err_win_to_posix(GetLastError());
 		if (errno != EACCES)
 			break;
-		if (!is_dir_empty(pathname)) {
+		if (!is_dir_empty(wpathname)) {
 			errno = ENOTEMPTY;
 			break;
 		}
@@ -276,16 +279,26 @@ int mingw_rmdir(const char *pathname)
 	while (ret == -1 && errno == EACCES && is_file_in_use_error(GetLastError()) &&
 	       ask_yes_no_if_possible("Deletion of directory '%s' failed. "
 			"Should I try again?", pathname))
-	       ret = rmdir(pathname);
+	       ret = _wrmdir(wpathname);
+	return ret;
+}
+
+int mingw_mkdir(const char *path, int mode)
+{
+	int ret;
+	wchar_t wpath[MAX_PATH];
+	if (xutftowcs_path(wpath, path) < 0)
+		return -1;
+	ret = _wmkdir(wpath);
 	return ret;
 }
 
-#undef open
 int mingw_open (const char *filename, int oflags, ...)
 {
 	va_list args;
 	unsigned mode;
 	int fd;
+	wchar_t wfilename[MAX_PATH];
 
 	va_start(args, oflags);
 	mode = va_arg(args, int);
@@ -294,10 +307,12 @@ int mingw_open (const char *filename, int oflags, ...)
 	if (filename && !strcmp(filename, "/dev/null"))
 		filename = "nul";
 
-	fd = open(filename, oflags, mode);
+	if (xutftowcs_path(wfilename, filename) < 0)
+		return -1;
+	fd = _wopen(wfilename, oflags, mode);
 
 	if (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {
-		DWORD attrs = GetFileAttributes(filename);
+		DWORD attrs = GetFileAttributesW(wfilename);
 		if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))
 			errno = EISDIR;
 	}
@@ -332,17 +347,28 @@ int mingw_fgetc(FILE *stream)
 #undef fopen
 FILE *mingw_fopen (const char *filename, const char *otype)
 {
+	FILE *file;
+	wchar_t wfilename[MAX_PATH], wotype[4];
 	if (filename && !strcmp(filename, "/dev/null"))
 		filename = "nul";
-	return fopen(filename, otype);
+	if (xutftowcs_path(wfilename, filename) < 0 ||
+		xutftowcs(wotype, otype, ARRAY_SIZE(wotype)) < 0)
+		return NULL;
+	file = _wfopen(wfilename, wotype);
+	return file;
 }
 
-#undef freopen
 FILE *mingw_freopen (const char *filename, const char *otype, FILE *stream)
 {
+	FILE *file;
+	wchar_t wfilename[MAX_PATH], wotype[4];
 	if (filename && !strcmp(filename, "/dev/null"))
 		filename = "nul";
-	return freopen(filename, otype, stream);
+	if (xutftowcs_path(wfilename, filename) < 0 ||
+		xutftowcs(wotype, otype, ARRAY_SIZE(wotype)) < 0)
+		return NULL;
+	file = _wfreopen(wfilename, wotype, stream);
+	return file;
 }
 
 #undef fflush
@@ -367,6 +393,31 @@ int mingw_fflush(FILE *stream)
 	return ret;
 }
 
+int mingw_access(const char *filename, int mode)
+{
+	wchar_t wfilename[MAX_PATH];
+	if (xutftowcs_path(wfilename, filename) < 0)
+		return -1;
+	/* X_OK is not supported by the MSVCRT version */
+	return _waccess(wfilename, mode & ~X_OK);
+}
+
+int mingw_chdir(const char *dirname)
+{
+	wchar_t wdirname[MAX_PATH];
+	if (xutftowcs_path(wdirname, dirname) < 0)
+		return -1;
+	return _wchdir(wdirname);
+}
+
+int mingw_chmod(const char *filename, int mode)
+{
+	wchar_t wfilename[MAX_PATH];
+	if (xutftowcs_path(wfilename, filename) < 0)
+		return -1;
+	return _wchmod(wfilename, mode);
+}
+
 /*
  * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
  * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
@@ -392,10 +443,12 @@ static inline time_t filetime_to_time_t(const FILETIME *ft)
  */
 static int do_lstat(int follow, const char *file_name, struct stat *buf)
 {
-	int err;
 	WIN32_FILE_ATTRIBUTE_DATA fdata;
+	wchar_t wfilename[MAX_PATH];
+	if (xutftowcs_path(wfilename, file_name) < 0)
+		return -1;
 
-	if (!(err = get_file_attr(file_name, &fdata))) {
+	if (GetFileAttributesExW(wfilename, GetFileExInfoStandard, &fdata)) {
 		buf->st_ino = 0;
 		buf->st_gid = 0;
 		buf->st_uid = 0;
@@ -408,8 +461,8 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)
 		buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
 		buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
 		if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
-			WIN32_FIND_DATAA findbuf;
-			HANDLE handle = FindFirstFileA(file_name, &findbuf);
+			WIN32_FIND_DATAW findbuf;
+			HANDLE handle = FindFirstFileW(wfilename, &findbuf);
 			if (handle != INVALID_HANDLE_VALUE) {
 				if ((findbuf.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) &&
 						(findbuf.dwReserved0 == IO_REPARSE_TAG_SYMLINK)) {
@@ -428,7 +481,23 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)
 		}
 		return 0;
 	}
-	errno = err;
+	switch (GetLastError()) {
+	case ERROR_ACCESS_DENIED:
+	case ERROR_SHARING_VIOLATION:
+	case ERROR_LOCK_VIOLATION:
+	case ERROR_SHARING_BUFFER_EXCEEDED:
+		errno = EACCES;
+		break;
+	case ERROR_BUFFER_OVERFLOW:
+		errno = ENAMETOOLONG;
+		break;
+	case ERROR_NOT_ENOUGH_MEMORY:
+		errno = ENOMEM;
+		break;
+	default:
+		errno = ENOENT;
+		break;
+	}
 	return -1;
 }
 
@@ -516,16 +585,20 @@ int mingw_utime (const char *file_name, const struct utimbuf *times)
 {
 	FILETIME mft, aft;
 	int fh, rc;
+	DWORD attrs;
+	wchar_t wfilename[MAX_PATH];
+	if (xutftowcs_path(wfilename, file_name) < 0)
+		return -1;
 
 	/* must have write permission */
-	DWORD attrs = GetFileAttributes(file_name);
+	attrs = GetFileAttributesW(wfilename);
 	if (attrs != INVALID_FILE_ATTRIBUTES &&
 	    (attrs & FILE_ATTRIBUTE_READONLY)) {
 		/* ignore errors here; open() will report them */
-		SetFileAttributes(file_name, attrs & ~FILE_ATTRIBUTE_READONLY);
+		SetFileAttributesW(wfilename, attrs & ~FILE_ATTRIBUTE_READONLY);
 	}
 
-	if ((fh = open(file_name, O_RDWR | O_BINARY)) < 0) {
+	if ((fh = _wopen(wfilename, O_RDWR | O_BINARY)) < 0) {
 		rc = -1;
 		goto revert_attrs;
 	}
@@ -548,7 +621,7 @@ revert_attrs:
 	if (attrs != INVALID_FILE_ATTRIBUTES &&
 	    (attrs & FILE_ATTRIBUTE_READONLY)) {
 		/* ignore errors again */
-		SetFileAttributes(file_name, attrs);
+		SetFileAttributesW(wfilename, attrs);
 	}
 	return rc;
 }
@@ -559,6 +632,18 @@ unsigned int sleep (unsigned int seconds)
 	return 0;
 }
 
+char *mingw_mktemp(char *template)
+{
+	wchar_t wtemplate[MAX_PATH];
+	if (xutftowcs_path(wtemplate, template) < 0)
+		return NULL;
+	if (!_wmktemp(wtemplate))
+		return NULL;
+	if (xwcstoutf(template, wtemplate, strlen(template) + 1) < 0)
+		return NULL;
+	return template;
+}
+
 int mkstemp(char *template)
 {
 	char *filename = mktemp(template);
@@ -617,17 +702,18 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)
 	return result;
 }
 
-#undef getcwd
 char *mingw_getcwd(char *pointer, int len)
 {
 	int i;
-	char *ret = getcwd(pointer, len);
-	if (!ret)
-		return ret;
+	wchar_t wpointer[MAX_PATH];
+	if (!_wgetcwd(wpointer, ARRAY_SIZE(wpointer)))
+		return NULL;
+	if (xwcstoutf(pointer, wpointer, len) < 0)
+		return NULL;
 	for (i = 0; pointer[i]; i++)
 		if (pointer[i] == '\\')
 			pointer[i] = '/';
-	return ret;
+	return pointer;
 }
 
 /*
@@ -1485,33 +1571,36 @@ int mingw_rename(const char *pold, const char *pnew)
 {
 	DWORD attrs, gle;
 	int tries = 0;
+	wchar_t wpold[MAX_PATH], wpnew[MAX_PATH];
+	if (xutftowcs_path(wpold, pold) < 0 || xutftowcs_path(wpnew, pnew) < 0)
+		return -1;
 
 	/*
 	 * Try native rename() first to get errno right.
 	 * It is based on MoveFile(), which cannot overwrite existing files.
 	 */
-	if (!rename(pold, pnew))
+	if (!_wrename(wpold, wpnew))
 		return 0;
 	if (errno != EEXIST)
 		return -1;
 repeat:
-	if (MoveFileEx(pold, pnew, MOVEFILE_REPLACE_EXISTING))
+	if (MoveFileExW(wpold, wpnew, MOVEFILE_REPLACE_EXISTING))
 		return 0;
 	/* TODO: translate more errors */
 	gle = GetLastError();
 	if (gle == ERROR_ACCESS_DENIED &&
-	    (attrs = GetFileAttributes(pnew)) != INVALID_FILE_ATTRIBUTES) {
+	    (attrs = GetFileAttributesW(wpnew)) != INVALID_FILE_ATTRIBUTES) {
 		if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
 			errno = EISDIR;
 			return -1;
 		}
 		if ((attrs & FILE_ATTRIBUTE_READONLY) &&
-		    SetFileAttributes(pnew, attrs & ~FILE_ATTRIBUTE_READONLY)) {
-			if (MoveFileEx(pold, pnew, MOVEFILE_REPLACE_EXISTING))
+		    SetFileAttributesW(wpnew, attrs & ~FILE_ATTRIBUTE_READONLY)) {
+			if (MoveFileExW(wpold, wpnew, MOVEFILE_REPLACE_EXISTING))
 				return 0;
 			gle = GetLastError();
 			/* revert file attributes on failure */
-			SetFileAttributes(pnew, attrs);
+			SetFileAttributesW(wpnew, attrs);
 		}
 	}
 	if (tries < ARRAY_SIZE(delay) && gle == ERROR_ACCESS_DENIED) {
@@ -1757,11 +1846,16 @@ void mingw_open_html(const char *unixpath)
 
 int link(const char *oldpath, const char *newpath)
 {
-	typedef BOOL (WINAPI *T)(const char*, const char*, LPSECURITY_ATTRIBUTES);
+	typedef BOOL (WINAPI *T)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
 	static T create_hard_link = NULL;
+	wchar_t woldpath[MAX_PATH], wnewpath[MAX_PATH];
+	if (xutftowcs_path(woldpath, oldpath) < 0 ||
+		xutftowcs_path(wnewpath, newpath) < 0)
+		return -1;
+
 	if (!create_hard_link) {
 		create_hard_link = (T) GetProcAddress(
-			GetModuleHandle("kernel32.dll"), "CreateHardLinkA");
+			GetModuleHandle("kernel32.dll"), "CreateHardLinkW");
 		if (!create_hard_link)
 			create_hard_link = (T)-1;
 	}
@@ -1769,7 +1863,7 @@ int link(const char *oldpath, const char *newpath)
 		errno = ENOSYS;
 		return -1;
 	}
-	if (!create_hard_link(newpath, oldpath, NULL)) {
+	if (!create_hard_link(wnewpath, woldpath, NULL)) {
 		errno = err_win_to_posix(GetLastError());
 		return -1;
 	}
diff --git a/compat/mingw.h b/compat/mingw.h
index 8dac6f9..405c08f 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -118,10 +118,7 @@ static inline int fcntl(int fd, int cmd, ...)
  * simple adaptors
  */
 
-static inline int mingw_mkdir(const char *path, int mode)
-{
-	return mkdir(path);
-}
+int mingw_mkdir(const char *path, int mode);
 #define mkdir mingw_mkdir
 
 #define WNOHANG 1
@@ -192,6 +189,19 @@ FILE *mingw_freopen (const char *filename, const char *otype, FILE *stream);
 int mingw_fflush(FILE *stream);
 #define fflush mingw_fflush
 
+int mingw_access(const char *filename, int mode);
+#undef access
+#define access mingw_access
+
+int mingw_chdir(const char *dirname);
+#define chdir mingw_chdir
+
+int mingw_chmod(const char *filename, int mode);
+#define chmod mingw_chmod
+
+char *mingw_mktemp(char *template);
+#define mktemp mingw_mktemp
+
 char *mingw_getcwd(char *pointer, int len);
 #define getcwd mingw_getcwd
 
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 2/3] Win32: Unicode file name support (dirent)
  2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
  2014-07-15 13:43       ` [PATCH 1/3] Win32: Unicode file name support (except dirent) Stepan Kasal
@ 2014-07-15 13:43       ` Stepan Kasal
  2014-07-15 13:43       ` [PATCH 3/3] tests: do not pass iso8859-1 encoded parameter Stepan Kasal
                         ` (2 subsequent siblings)
  4 siblings, 0 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-15 13:43 UTC (permalink / raw)
  To: Karsten Blees, Johannes Sixt
  Cc: GIT Mailing-list, msysGit, Karsten Blees, Stepan Kasal

From: Karsten Blees <blees@dcon.de>
Date: Sat, 14 Jan 2012 22:01:09 +0100

Changes opendir/readdir to use Windows Unicode APIs and convert between
UTF-8/UTF-16.

Removes parameter checks that are already covered by xutftowcs_path. This
changes detection of ENAMETOOLONG from MAX_PATH - 2 to MAX_PATH (matching
is_dir_empty in mingw.c). If name + "/*" or the resulting absolute path is
too long, FindFirstFile fails and errno is set through err_win_to_posix.

Increases the size of dirent.d_name to accommodate the full
WIN32_FIND_DATA.cFileName converted to UTF-8 (UTF-16 to UTF-8 conversion
may grow by factor three in the worst case).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 compat/win32/dirent.c | 30 ++++++++++--------------------
 compat/win32/dirent.h |  2 +-
 2 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/compat/win32/dirent.c b/compat/win32/dirent.c
index 82a515c..52420ec 100644
--- a/compat/win32/dirent.c
+++ b/compat/win32/dirent.c
@@ -6,10 +6,10 @@ struct DIR {
 	int dd_stat;          /* 0-based index */
 };
 
-static inline void finddata2dirent(struct dirent *ent, WIN32_FIND_DATAA *fdata)
+static inline void finddata2dirent(struct dirent *ent, WIN32_FIND_DATAW *fdata)
 {
-	/* copy file name from WIN32_FIND_DATA to dirent */
-	memcpy(ent->d_name, fdata->cFileName, sizeof(ent->d_name));
+	/* convert UTF-16 name to UTF-8 */
+	xwcstoutf(ent->d_name, fdata->cFileName, sizeof(ent->d_name));
 
 	/* Set file type, based on WIN32_FIND_DATA */
 	if (fdata->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
@@ -20,25 +20,15 @@ static inline void finddata2dirent(struct dirent *ent, WIN32_FIND_DATAA *fdata)
 
 DIR *opendir(const char *name)
 {
-	char pattern[MAX_PATH];
-	WIN32_FIND_DATAA fdata;
+	wchar_t pattern[MAX_PATH + 2]; /* + 2 for '/' '*' */
+	WIN32_FIND_DATAW fdata;
 	HANDLE h;
 	int len;
 	DIR *dir;
 
-	/* check that name is not NULL */
-	if (!name) {
-		errno = EINVAL;
+	/* convert name to UTF-16 and check length < MAX_PATH */
+	if ((len = xutftowcs_path(pattern, name)) < 0)
 		return NULL;
-	}
-	/* check that the pattern won't be too long for FindFirstFileA */
-	len = strlen(name);
-	if (len + 2 >= MAX_PATH) {
-		errno = ENAMETOOLONG;
-		return NULL;
-	}
-	/* copy name to temp buffer */
-	memcpy(pattern, name, len + 1);
 
 	/* append optional '/' and wildcard '*' */
 	if (len && !is_dir_sep(pattern[len - 1]))
@@ -47,7 +37,7 @@ DIR *opendir(const char *name)
 	pattern[len] = 0;
 
 	/* open find handle */
-	h = FindFirstFileA(pattern, &fdata);
+	h = FindFirstFileW(pattern, &fdata);
 	if (h == INVALID_HANDLE_VALUE) {
 		DWORD err = GetLastError();
 		errno = (err == ERROR_DIRECTORY) ? ENOTDIR : err_win_to_posix(err);
@@ -72,8 +62,8 @@ struct dirent *readdir(DIR *dir)
 	/* if first entry, dirent has already been set up by opendir */
 	if (dir->dd_stat) {
 		/* get next entry and convert from WIN32_FIND_DATA to dirent */
-		WIN32_FIND_DATAA fdata;
-		if (FindNextFileA(dir->dd_handle, &fdata)) {
+		WIN32_FIND_DATAW fdata;
+		if (FindNextFileW(dir->dd_handle, &fdata)) {
 			finddata2dirent(&dir->dd_dir, &fdata);
 		} else {
 			DWORD lasterr = GetLastError();
diff --git a/compat/win32/dirent.h b/compat/win32/dirent.h
index 8838cd6..058207e 100644
--- a/compat/win32/dirent.h
+++ b/compat/win32/dirent.h
@@ -10,7 +10,7 @@ typedef struct DIR DIR;
 
 struct dirent {
 	unsigned char d_type;      /* file type to prevent lstat after readdir */
-	char d_name[MAX_PATH];     /* file name */
+	char d_name[MAX_PATH * 3]; /* file name (* 3 for UTF-8 conversion) */
 };
 
 DIR *opendir(const char *dirname);
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 3/3] tests: do not pass iso8859-1 encoded parameter
  2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
  2014-07-15 13:43       ` [PATCH 1/3] Win32: Unicode file name support (except dirent) Stepan Kasal
  2014-07-15 13:43       ` [PATCH 2/3] Win32: Unicode file name support (dirent) Stepan Kasal
@ 2014-07-15 13:43       ` Stepan Kasal
  2014-07-15 13:53       ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
  2014-07-15 18:20       ` Junio C Hamano
  4 siblings, 0 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-15 13:43 UTC (permalink / raw)
  To: Karsten Blees, Johannes Sixt
  Cc: GIT Mailing-list, msysGit, Pat Thoyts, Stepan Kasal

From: Pat Thoyts <patthoyts@users.sourceforge.net>
Date: Mon, 2 Sep 2013 15:44:54 +0100

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>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 t/t4041-diff-submodule-option.sh | 6 ++++--
 t/t4205-log-pretty-formats.sh    | 2 +-
 t/t6006-rev-list-format.sh       | 4 ++--
 t/t7102-reset.sh                 | 8 ++++++--
 4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index 463d63b..e432896 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -26,8 +26,10 @@ add_file () {
 			echo "$name" >"$name" &&
 			git add "$name" &&
 			test_tick &&
-			msg_added_iso88591=$(echo "Add $name ($added $name)" | iconv -f utf-8 -t $test_encoding) &&
-			git -c "i18n.commitEncoding=$test_encoding" commit -m "$msg_added_iso88591"
+			# "git commit -m" would break MinGW, as Windows refuse to pass
+			# $test_encoding encoded parameter to git.
+			echo "Add $name ($added $name)" | iconv -f utf-8 -t $test_encoding |
+			git -c "i18n.commitEncoding=$test_encoding" commit -F -
 		done >/dev/null &&
 		git rev-parse --short --verify HEAD
 	)
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index c84ec9a..349c531 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -31,7 +31,7 @@ test_expect_success 'set up basic repos' '
 	git add foo &&
 	test_tick &&
 	git config i18n.commitEncoding $test_encoding &&
-	git commit -m "$(commit_msg $test_encoding)" &&
+	commit_msg $test_encoding | git commit -F - &&
 	git add bar &&
 	test_tick &&
 	git commit -m "add bar" &&
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index 88ed319..a02a45a 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -35,13 +35,13 @@ test_expect_success 'setup' '
 	: >foo &&
 	git add foo &&
 	git config i18n.commitEncoding $test_encoding &&
-	git commit -m "$added_iso88591" &&
+	echo "$added_iso88591" | git commit -F - &&
 	head1=$(git rev-parse --verify HEAD) &&
 	head1_short=$(git rev-parse --verify --short $head1) &&
 	tree1=$(git rev-parse --verify HEAD:) &&
 	tree1_short=$(git rev-parse --verify --short $tree1) &&
 	echo "$changed" > foo &&
-	git commit -a -m "$changed_iso88591" &&
+	echo "$changed_iso88591" | git commit -a -F - &&
 	head2=$(git rev-parse --verify HEAD) &&
 	head2_short=$(git rev-parse --verify --short $head2) &&
 	tree2=$(git rev-parse --verify HEAD:) &&
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index ee703be..98bcfe2 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -44,7 +44,9 @@ test_expect_success 'creating initial files and commits' '
 
 	echo "1st line 2nd file" >secondfile &&
 	echo "2nd line 2nd file" >>secondfile &&
-	git -c "i18n.commitEncoding=$test_encoding" commit -a -m "$(commit_msg $test_encoding)" &&
+	# "git commit -m" would break MinGW, as Windows refuse to pass
+	# $test_encoding encoded parameter to git.
+	commit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&
 	head5=$(git rev-parse --verify HEAD)
 '
 # git log --pretty=oneline # to see those SHA1 involved
@@ -334,7 +336,9 @@ test_expect_success 'redoing the last two commits should succeed' '
 
 	echo "1st line 2nd file" >secondfile &&
 	echo "2nd line 2nd file" >>secondfile &&
-	git -c "i18n.commitEncoding=$test_encoding" commit -a -m "$(commit_msg $test_encoding)" &&
+	# "git commit -m" would break MinGW, as Windows refuse to pass
+	# $test_encoding encoded parameter to git.
+	commit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&
 	check_changes $head5
 '
 
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH 0/3] fix test suite with mingw-unicode patches
  2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
                         ` (2 preceding siblings ...)
  2014-07-15 13:43       ` [PATCH 3/3] tests: do not pass iso8859-1 encoded parameter Stepan Kasal
@ 2014-07-15 13:53       ` Stepan Kasal
  2014-07-15 18:20       ` Junio C Hamano
  4 siblings, 0 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-15 13:53 UTC (permalink / raw)
  To: Karsten Blees, Johannes Sixt; +Cc: GIT Mailing-list, msysGit

Hello,

I'm sorry that I have to reply to my own mail, but I forgot this:

> Karsten Blees (2):
>   Win32: Unicode file name support (except dirent)
.. has this one squashed in:
   Win32: fix detection of empty directories in is_dir_empty
https://github.com/msysgit/git/commit/91db148

>   Win32: Unicode file name support (dirent)

Both of theese patches are in msysgit for more than 2 years.

> Pat Thoyts and Stepan Kasal(1):
>   tests: do not pass iso8859-1 encoded parameter

This one is relatively new: replaces "git commit -m"
by "git commit -F -" to work around a Windows bug^H^H^Hfeature.

Stepan

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 0/3] fix test suite with mingw-unicode patches
  2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
                         ` (3 preceding siblings ...)
  2014-07-15 13:53       ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
@ 2014-07-15 18:20       ` Junio C Hamano
  2014-07-15 22:52         ` Karsten Blees
  4 siblings, 1 reply; 46+ messages in thread
From: Junio C Hamano @ 2014-07-15 18:20 UTC (permalink / raw)
  To: Stepan Kasal; +Cc: Karsten Blees, Johannes Sixt, GIT Mailing-list, msysGit

Stepan Kasal <kasal@ucw.cz> writes:

> Hello Hannes,
> attached please find the patches that Karsten pointed out:
>
> 1) The unicode file name support was omitted from his unicode patch
> series; my mistake, sorry.  There is still big part missing: support
> for unicode environment; I can only hope the tests would choke on
> that.
>
> 2) Windows cannot pass non-UTF parameters (commit messages in this
> case): original patch by Pat Thoyts was extended to apply to other
> similar cases: the commit msg is passed through stdin.
>
> If there are still problems remaining, please tell us.
>
> Thanks,
> 	Stepan
>
> Karsten Blees (2):
>   Win32: Unicode file name support (except dirent)
>   Win32: Unicode file name support (dirent)
>
> Pat Thoyts and Stepan Kasal(1):
>   tests: do not pass iso8859-1 encoded parameter

Thanks.  I'll queue these and wait for Windows folks to respond.
With favourable feedback they can go directly from pu to master, I
would think.

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 0/3] fix test suite with mingw-unicode patches
  2014-07-15 18:20       ` Junio C Hamano
@ 2014-07-15 22:52         ` Karsten Blees
  2014-07-15 22:53           ` [PATCH 1/2] MinGW: fix compile error due to missing ELOOP Karsten Blees
                             ` (2 more replies)
  0 siblings, 3 replies; 46+ messages in thread
From: Karsten Blees @ 2014-07-15 22:52 UTC (permalink / raw)
  To: Junio C Hamano, Stepan Kasal; +Cc: Johannes Sixt, GIT Mailing-list, msysGit

Am 15.07.2014 20:20, schrieb Junio C Hamano:
> Stepan Kasal <kasal@ucw.cz> writes:
> 
>> Hello Hannes,
>> attached please find the patches that Karsten pointed out:
>>
>> 1) The unicode file name support was omitted from his unicode patch
>> series; my mistake, sorry.  There is still big part missing: support
>> for unicode environment; I can only hope the tests would choke on
>> that.
>>
>> 2) Windows cannot pass non-UTF parameters (commit messages in this
>> case): original patch by Pat Thoyts was extended to apply to other
>> similar cases: the commit msg is passed through stdin.
>>
>> If there are still problems remaining, please tell us.
>>
>> Thanks,
>> 	Stepan
>>
>> Karsten Blees (2):
>>   Win32: Unicode file name support (except dirent)
>>   Win32: Unicode file name support (dirent)
>>
>> Pat Thoyts and Stepan Kasal(1):
>>   tests: do not pass iso8859-1 encoded parameter
> 
> Thanks.  I'll queue these and wait for Windows folks to respond.
> With favourable feedback they can go directly from pu to master, I
> would think.
> 

Looking good. After fixing the ELOOP and fchmod issues (see followup
patches), there are 9 test failures left. Only one of these is
environment related, and for the rest we have fixes in the msysgit
fork:


* t0081-line-buffer: 1

Using file descriptor other than 0, 1, 2.
https://github.com/msysgit/git/commit/4940c51a


* t0110-urlmatch-normalization: 1

Passing binary data on the command line...would have to teach test-urlmatch-normalization.c to read from stdin or file.
https://github.com/msysgit/git/commit/be0d6dee


* t4036-format-patch-signer-mime: 1

not ok 4 - format with non ASCII signer name
#
#               GIT_COMMITTER_NAME="はまの ふにおう" \
#               git format-patch -s --stdout -1 >output &&
#               grep Content-Type output
#

Passing non-ASCII by environment variable, will be fixed by Unicode environment support.


* t4201-shortlog: 3

Passing binary data on the command line ('git-commit -m').
https://github.com/msysgit/git/commit/3717ce1b


* t4210-log-i18n: 2

Passing binary data on the command line ('git log --grep=$latin1_e').
https://github.com/msysgit/git/commit/dd2defa3


* t7001-mv: 6

cp -P fails in MinGW - perhaps use the long option forms (--no-dereference)?
https://github.com/msysgit/git/commit/00764ca1


* t8001-annotate/t8002-blame: 5

Msys.dll thinks '-L/regex/' is an absolute path and expands to '-LC:/msysgit/regex/'.
https://github.com/msysgit/git/commit/2d52168a


* t8005-blame-i18n: 4

Passing binary data on the command line ('git-commit --author -m').
https://github.com/msysgit/git/commit/3717ce1b


* t9902-completion: 2

Must use 'pwd -W' to get Windows-style absolute paths.
https://github.com/msysgit/git/commit/9b612448

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH 1/2] MinGW: fix compile error due to missing ELOOP
  2014-07-15 22:52         ` Karsten Blees
@ 2014-07-15 22:53           ` Karsten Blees
  2014-07-15 23:42             ` Jonathan Nieder
  2014-07-16 17:43             ` Junio C Hamano
  2014-07-15 22:54           ` [PATCH 2/2] config: use chmod() instead of fchmod() Karsten Blees
  2014-07-16  9:29           ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
  2 siblings, 2 replies; 46+ messages in thread
From: Karsten Blees @ 2014-07-15 22:53 UTC (permalink / raw)
  To: Junio C Hamano, Stepan Kasal; +Cc: Johannes Sixt, GIT Mailing-list, msysGit

MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many
links") instead.

Signed-off-by: Karsten Blees <blees@dcon.de>
---
 compat/mingw.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compat/mingw.h b/compat/mingw.h
index 405c08f..510530c 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -35,6 +35,9 @@ typedef int socklen_t;
 #ifndef EWOULDBLOCK
 #define EWOULDBLOCK EAGAIN
 #endif
+#ifndef ELOOP
+#define ELOOP EMLINK
+#endif
 #define SHUT_WR SD_SEND
 
 #define SIGHUP 1
-- 
2.0.1.779.g26aeac4.dirty

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 2/2] config: use chmod() instead of fchmod()
  2014-07-15 22:52         ` Karsten Blees
  2014-07-15 22:53           ` [PATCH 1/2] MinGW: fix compile error due to missing ELOOP Karsten Blees
@ 2014-07-15 22:54           ` Karsten Blees
  2014-07-16  5:33             ` Johannes Sixt
  2014-07-16 22:16             ` Junio C Hamano
  2014-07-16  9:29           ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
  2 siblings, 2 replies; 46+ messages in thread
From: Karsten Blees @ 2014-07-15 22:54 UTC (permalink / raw)
  To: Junio C Hamano, Stepan Kasal; +Cc: Johannes Sixt, GIT Mailing-list, msysGit

There is no fchmod() on native Windows platforms (MinGW and MSVC), and the
equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.

Use chmod() instead.

Signed-off-by: Karsten Blees <blees@dcon.de>
---
 config.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/config.c b/config.c
index ba882a1..9767c4b 100644
--- a/config.c
+++ b/config.c
@@ -1636,8 +1636,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
 			MAP_PRIVATE, in_fd, 0);
 		close(in_fd);
 
-		if (fchmod(fd, st.st_mode & 07777) < 0) {
-			error("fchmod on %s failed: %s",
+		if (chmod(lock->filename, st.st_mode & 07777) < 0) {
+			error("chmod on %s failed: %s",
 				lock->filename, strerror(errno));
 			ret = CONFIG_NO_WRITE;
 			goto out_free;
@@ -1815,8 +1815,8 @@ int git_config_rename_section_in_file(const char *config_filename,
 
 	fstat(fileno(config_file), &st);
 
-	if (fchmod(out_fd, st.st_mode & 07777) < 0) {
-		ret = error("fchmod on %s failed: %s",
+	if (chmod(lock->filename, st.st_mode & 07777) < 0) {
+		ret = error("chmod on %s failed: %s",
 				lock->filename, strerror(errno));
 		goto out;
 	}
-- 
2.0.1.779.g26aeac4.dirty

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH 1/2] MinGW: fix compile error due to missing ELOOP
  2014-07-15 22:53           ` [PATCH 1/2] MinGW: fix compile error due to missing ELOOP Karsten Blees
@ 2014-07-15 23:42             ` Jonathan Nieder
  2014-07-15 23:57               ` Karsten Blees
  2014-07-16 17:43             ` Junio C Hamano
  1 sibling, 1 reply; 46+ messages in thread
From: Jonathan Nieder @ 2014-07-15 23:42 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Junio C Hamano, Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit

Karsten Blees wrote:

> MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many
> links") instead.
[...]
> +#ifndef ELOOP
> +#define ELOOP EMLINK
> +#endif

This could use

	#define ELOOP WSAELOOP

as an alternative.  But it shouldn't matter since git doesn't look for
EMLINK anywhere (EMLINK = 31, WSAELOOP = wsabaseerr+62 = 10062).

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 1/2] MinGW: fix compile error due to missing ELOOP
  2014-07-15 23:42             ` Jonathan Nieder
@ 2014-07-15 23:57               ` Karsten Blees
  0 siblings, 0 replies; 46+ messages in thread
From: Karsten Blees @ 2014-07-15 23:57 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Junio C Hamano, Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit

Am 16.07.2014 01:42, schrieb Jonathan Nieder:
> Karsten Blees wrote:
> 
>> MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many
>> links") instead.
> [...]
>> +#ifndef ELOOP
>> +#define ELOOP EMLINK
>> +#endif
> 
> This could use
> 
> 	#define ELOOP WSAELOOP
> 
> as an alternative.  But it shouldn't matter since git doesn't look for
> EMLINK anywhere (EMLINK = 31, WSAELOOP = wsabaseerr+62 = 10062).
> 
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
> 

It matters when we report the error to the user (i.e. via die_errno):

strerror(EMLINK) -> "Too many links"
strerror(10062)  -> "Unknown error"

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 2/2] config: use chmod() instead of fchmod()
  2014-07-15 22:54           ` [PATCH 2/2] config: use chmod() instead of fchmod() Karsten Blees
@ 2014-07-16  5:33             ` Johannes Sixt
  2014-07-16 10:53               ` Karsten Blees
  2014-07-16 22:16             ` Junio C Hamano
  1 sibling, 1 reply; 46+ messages in thread
From: Johannes Sixt @ 2014-07-16  5:33 UTC (permalink / raw)
  To: Karsten Blees, Junio C Hamano, Stepan Kasal; +Cc: GIT Mailing-list, msysGit

Am 16.07.2014 00:54, schrieb Karsten Blees:
> There is no fchmod() on native Windows platforms (MinGW and MSVC), and the
> equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.
> 
> Use chmod() instead.
> 
> Signed-off-by: Karsten Blees <blees@dcon.de>
> ---
>  config.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/config.c b/config.c
> index ba882a1..9767c4b 100644
> --- a/config.c
> +++ b/config.c
> @@ -1636,8 +1636,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
>  			MAP_PRIVATE, in_fd, 0);
>  		close(in_fd);
>  
> -		if (fchmod(fd, st.st_mode & 07777) < 0) {
> -			error("fchmod on %s failed: %s",
> +		if (chmod(lock->filename, st.st_mode & 07777) < 0) {
> +			error("chmod on %s failed: %s",
>  				lock->filename, strerror(errno));
>  			ret = CONFIG_NO_WRITE;
>  			goto out_free;
> @@ -1815,8 +1815,8 @@ int git_config_rename_section_in_file(const char *config_filename,
>  
>  	fstat(fileno(config_file), &st);
>  
> -	if (fchmod(out_fd, st.st_mode & 07777) < 0) {
> -		ret = error("fchmod on %s failed: %s",
> +	if (chmod(lock->filename, st.st_mode & 07777) < 0) {
> +		ret = error("chmod on %s failed: %s",
>  				lock->filename, strerror(errno));
>  		goto out;
>  	}
> 

I assume you tested this patch on Windows. I am mildly surprised that
(on Windows) chmod() works on a file that is still open.

-- Hannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 0/3] fix test suite with mingw-unicode patches
  2014-07-15 22:52         ` Karsten Blees
  2014-07-15 22:53           ` [PATCH 1/2] MinGW: fix compile error due to missing ELOOP Karsten Blees
  2014-07-15 22:54           ` [PATCH 2/2] config: use chmod() instead of fchmod() Karsten Blees
@ 2014-07-16  9:29           ` Stepan Kasal
  2014-07-16 11:01             ` Thomas Braun
  2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
  2 siblings, 2 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-16  9:29 UTC (permalink / raw)
  To: Karsten Blees; +Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit

Hello Karsten,

thanks for your analysis.  Most of the patches you refer to are simply
switching off tests for MINGW; let me comment on the remaining ones:

> * t0110-urlmatch-normalization: 1
> 
> Passing binary data on the command line...would have to
> teach test-urlmatch-normalization.c to read from stdin or file.
> https://github.com/msysgit/git/commit/be0d6dee

Indeed, that would be better solution.  For now, I'm going to submit the
switch-off patch you mention.

> * t4036-format-patch-signer-mime: 1
> 
> Passing non-ASCII by environment variable, will be fixed by Unicode
> environment support.

Will submit that patch series soon.

> * t7001-mv: 6
> cp -P fails in MinGW - perhaps use the long option forms (--no-dereference)?

"cp -P" fails with our 2001-edition of cp, so msysgit had to revert:
https://github.com/msysgit/git/commit/6d3e23d4

But I was ashamed to mention that upstream; and I hope mingwGitDevEnv is
going to solve that.

> * t8001-annotate/t8002-blame: 5
> 
> Msys.dll thinks '-L/regex/' is an absolute path and expands to '-LC:/msysgit/regex/'.
> https://github.com/msysgit/git/commit/2d52168a

Nice!  But I'm afraid the patch cannot be submitted upstream as it is.

I think the hack could be automated by processing options "-L*" this way:
    sed 'sX\(^-L\|,\)\^\?/X&\\;*Xg'
Then it would become only few lines at the top of the script, executed
on mingw only.
I hope to submit the patch in this form soon.

Have a nice day,
	Stepan

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 2/2] config: use chmod() instead of fchmod()
  2014-07-16  5:33             ` Johannes Sixt
@ 2014-07-16 10:53               ` Karsten Blees
  0 siblings, 0 replies; 46+ messages in thread
From: Karsten Blees @ 2014-07-16 10:53 UTC (permalink / raw)
  To: Johannes Sixt, Junio C Hamano, Stepan Kasal; +Cc: GIT Mailing-list, msysGit

Am 16.07.2014 07:33, schrieb Johannes Sixt:
> Am 16.07.2014 00:54, schrieb Karsten Blees:
>> There is no fchmod() on native Windows platforms (MinGW and MSVC), and the
>> equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.
>>
>> Use chmod() instead.
>>
>> Signed-off-by: Karsten Blees <blees@dcon.de>
>> ---
>>  config.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/config.c b/config.c
>> index ba882a1..9767c4b 100644
>> --- a/config.c
>> +++ b/config.c
>> @@ -1636,8 +1636,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
>>  			MAP_PRIVATE, in_fd, 0);
>>  		close(in_fd);
>>  
>> -		if (fchmod(fd, st.st_mode & 07777) < 0) {
>> -			error("fchmod on %s failed: %s",
>> +		if (chmod(lock->filename, st.st_mode & 07777) < 0) {
>> +			error("chmod on %s failed: %s",
>>  				lock->filename, strerror(errno));
>>  			ret = CONFIG_NO_WRITE;
>>  			goto out_free;
>> @@ -1815,8 +1815,8 @@ int git_config_rename_section_in_file(const char *config_filename,
>>  
>>  	fstat(fileno(config_file), &st);
>>  
>> -	if (fchmod(out_fd, st.st_mode & 07777) < 0) {
>> -		ret = error("fchmod on %s failed: %s",
>> +	if (chmod(lock->filename, st.st_mode & 07777) < 0) {
>> +		ret = error("chmod on %s failed: %s",
>>  				lock->filename, strerror(errno));
>>  		goto out;
>>  	}
>>
> 
> I assume you tested this patch on Windows. I am mildly surprised that
> (on Windows) chmod() works on a file that is still open.
> 
> -- Hannes
> 

Yes, file attributes can be set independently of open files. In fact, existing
code in git already does that in many places (via adjust_shared_perm(), which
is typically called while the file is open).

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 0/3] fix test suite with mingw-unicode patches
  2014-07-16  9:29           ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
@ 2014-07-16 11:01             ` Thomas Braun
  2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
  1 sibling, 0 replies; 46+ messages in thread
From: Thomas Braun @ 2014-07-16 11:01 UTC (permalink / raw)
  To: Stepan Kasal, Karsten Blees
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit

Am 16.07.2014 11:29, schrieb Stepan Kasal:
>> * t7001-mv: 6
>> cp -P fails in MinGW - perhaps use the long option forms (--no-dereference)?
> 
> "cp -P" fails with our 2001-edition of cp, so msysgit had to revert:
> https://github.com/msysgit/git/commit/6d3e23d4
> 
> But I was ashamed to mention that upstream; and I hope mingwGitDevEnv is
> going to solve that.

Yes it does. cp in mingwGitDevEnv is from coreutils 5.97 and knows about -P.

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 1/2] MinGW: fix compile error due to missing ELOOP
  2014-07-15 22:53           ` [PATCH 1/2] MinGW: fix compile error due to missing ELOOP Karsten Blees
  2014-07-15 23:42             ` Jonathan Nieder
@ 2014-07-16 17:43             ` Junio C Hamano
  1 sibling, 0 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-16 17:43 UTC (permalink / raw)
  To: Karsten Blees; +Cc: Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit

Karsten Blees <karsten.blees@gmail.com> writes:

> MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many
> links") instead.
>
> Signed-off-by: Karsten Blees <blees@dcon.de>
> ---

Thanks; will apply directly to 'master'.

>  compat/mingw.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/compat/mingw.h b/compat/mingw.h
> index 405c08f..510530c 100644
> --- a/compat/mingw.h
> +++ b/compat/mingw.h
> @@ -35,6 +35,9 @@ typedef int socklen_t;
>  #ifndef EWOULDBLOCK
>  #define EWOULDBLOCK EAGAIN
>  #endif
> +#ifndef ELOOP
> +#define ELOOP EMLINK
> +#endif
>  #define SHUT_WR SD_SEND
>  
>  #define SIGHUP 1
> -- 
> 2.0.1.779.g26aeac4.dirty
>
> -- 

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 2/2] config: use chmod() instead of fchmod()
  2014-07-15 22:54           ` [PATCH 2/2] config: use chmod() instead of fchmod() Karsten Blees
  2014-07-16  5:33             ` Johannes Sixt
@ 2014-07-16 22:16             ` Junio C Hamano
  2014-07-17  8:57               ` Karsten Blees
  1 sibling, 1 reply; 46+ messages in thread
From: Junio C Hamano @ 2014-07-16 22:16 UTC (permalink / raw)
  To: Karsten Blees; +Cc: Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit

Karsten Blees <karsten.blees@gmail.com> writes:

> There is no fchmod() on native Windows platforms (MinGW and MSVC), and the
> equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.
>
> Use chmod() instead.
>
> Signed-off-by: Karsten Blees <blees@dcon.de>
> ---

I am wondering if it is saner to just revert the fchmod() patch and
replace it with something along the lines of

http://thread.gmane.org/gmane.comp.version-control.git/251682/focus=253219

Having said that, these are the only two callers of fchmod()
currently in our code base, so I'll queue this patch to allow us to
kick the problem-can down the road ;-)

Thanks.

>  config.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/config.c b/config.c
> index ba882a1..9767c4b 100644
> --- a/config.c
> +++ b/config.c
> @@ -1636,8 +1636,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
>  			MAP_PRIVATE, in_fd, 0);
>  		close(in_fd);
>  
> -		if (fchmod(fd, st.st_mode & 07777) < 0) {
> -			error("fchmod on %s failed: %s",
> +		if (chmod(lock->filename, st.st_mode & 07777) < 0) {
> +			error("chmod on %s failed: %s",
>  				lock->filename, strerror(errno));
>  			ret = CONFIG_NO_WRITE;
>  			goto out_free;
> @@ -1815,8 +1815,8 @@ int git_config_rename_section_in_file(const char *config_filename,
>  
>  	fstat(fileno(config_file), &st);
>  
> -	if (fchmod(out_fd, st.st_mode & 07777) < 0) {
> -		ret = error("fchmod on %s failed: %s",
> +	if (chmod(lock->filename, st.st_mode & 07777) < 0) {
> +		ret = error("chmod on %s failed: %s",
>  				lock->filename, strerror(errno));
>  		goto out;
>  	}
> -- 
> 2.0.1.779.g26aeac4.dirty
>
> -- 

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 2/2] config: use chmod() instead of fchmod()
  2014-07-16 22:16             ` Junio C Hamano
@ 2014-07-17  8:57               ` Karsten Blees
  0 siblings, 0 replies; 46+ messages in thread
From: Karsten Blees @ 2014-07-17  8:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit

Am 17.07.2014 00:16, schrieb Junio C Hamano:
> Karsten Blees <karsten.blees@gmail.com> writes:
> 
>> There is no fchmod() on native Windows platforms (MinGW and MSVC), and the
>> equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.
>>
>> Use chmod() instead.
>>
>> Signed-off-by: Karsten Blees <blees@dcon.de>
>> ---
> 
> I am wondering if it is saner to just revert the fchmod() patch and
> replace it with something along the lines of
> 
> http://thread.gmane.org/gmane.comp.version-control.git/251682/focus=253219
> 

I also think it makes a lot of sense to handle permissions centrally.

However, with this patch, the permissions of the target file will
additionally be limited by umask (by passing them to open()), and then
overridden completely if core.sharedRepository is set.

Perhaps the lockfile API should respect the location of the lock files
(i.e. use core.sharedRepository in .git, 0666 in the work-tree, and
copy permissions anywhere else).

Another thing I find strange is that, by doing copy/replace, git silently
overwrites readonly files. If we grab the permissions from the source
file anyway, we should perhaps add 'if (!(perms & 0222)) error("file
is readonly");', or even 'access(filename, W_OK)'?

> Having said that, these are the only two callers of fchmod()
> currently in our code base, so I'll queue this patch to allow us to
> kick the problem-can down the road ;-)
> 

Thanks.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH 0/6] mingw test fixes
  2014-07-16  9:29           ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
  2014-07-16 11:01             ` Thomas Braun
@ 2014-07-17 15:36             ` Stepan Kasal
  2014-07-17 15:37               ` [PATCH 1/6] MinGW: Skip test redirecting to fd 4 Stepan Kasal
                                 ` (5 more replies)
  1 sibling, 6 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-17 15:36 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit, Stepan Kasal

Hello,
this is a collection of quality test suite fixes, hand picked with care,
following the expert advice by Karsten.  :-)

Most of them just switch off the tests on MinGW, one uses `pwd -W' to get
the reeal windows path.  All of these are time proven, they have been in
msysgit since Dec 2013, at least.   ;-)

The fix for t8001,2 (annotate, blame) was created in Sep 2013 in the
straightforward form: editing all the regexps in the long test file:
https://github.com/msysgit/git/commit/2d52168a

I have replaced it by a more tricky version that changes each -L option on
the fly, just before it is passed to the executable.
This is new code, but I beleive it is better suited for the common git
sources.

Johannes Schindelin (2):
  MinGW: Skip test redirecting to fd 4
  Disable t0110's high-bit test on Windows

Karsten Blees (2):
  MinGW: disable legacy encoding tests
  t800[12]: work around MSys limitation

Pat Thoyts (2):
  t4210: skip command-line encoding tests on mingw
  t9902: mingw-specific fix for gitfile link files

 t/annotate-tests.sh               | 12 ++++++++++++
 t/t0081-line-buffer.sh            |  2 +-
 t/t0110-urlmatch-normalization.sh |  2 +-
 t/t3901-i18n-patch.sh             | 19 +++++++++++--------
 t/t4201-shortlog.sh               |  6 +++---
 t/t4210-log-i18n.sh               |  4 ++--
 t/t8005-blame-i18n.sh             |  8 ++++----
 t/t9902-completion.sh             | 17 +++++++++++++----
 8 files changed, 47 insertions(+), 23 deletions(-)

-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH 1/6] MinGW: Skip test redirecting to fd 4
  2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
@ 2014-07-17 15:37               ` Stepan Kasal
  2014-07-17 18:41                 ` Junio C Hamano
  2014-07-17 15:37               ` [PATCH 2/6] Disable t0110's high-bit test on Windows Stepan Kasal
                                 ` (4 subsequent siblings)
  5 siblings, 1 reply; 46+ messages in thread
From: Stepan Kasal @ 2014-07-17 15:37 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit,
	Johannes Schindelin, Stepan Kasal

From: Johannes Schindelin <johannes.schindelin@gmx.de>

... because that does not work in MinGW.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 t/t0081-line-buffer.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
index bd83ed3..25dba00 100755
--- a/t/t0081-line-buffer.sh
+++ b/t/t0081-line-buffer.sh
@@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
 	test_cmp expect actual
 '
 
-test_expect_success 'read from file descriptor' '
+test_expect_success NOT_MINGW 'read from file descriptor' '
 	rm -f input &&
 	echo hello >expect &&
 	echo hello >input &&
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 2/6] Disable t0110's high-bit test on Windows
  2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
  2014-07-17 15:37               ` [PATCH 1/6] MinGW: Skip test redirecting to fd 4 Stepan Kasal
@ 2014-07-17 15:37               ` Stepan Kasal
  2014-07-17 18:20                 ` Karsten Blees
  2014-07-17 15:37               ` [PATCH 3/6] MinGW: disable legacy encoding tests Stepan Kasal
                                 ` (3 subsequent siblings)
  5 siblings, 1 reply; 46+ messages in thread
From: Stepan Kasal @ 2014-07-17 15:37 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit,
	Johannes Schindelin, Stepan Kasal

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 t/t0110-urlmatch-normalization.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t0110-urlmatch-normalization.sh b/t/t0110-urlmatch-normalization.sh
index 8d6096d..bcbb825 100755
--- a/t/t0110-urlmatch-normalization.sh
+++ b/t/t0110-urlmatch-normalization.sh
@@ -117,7 +117,7 @@ test_expect_success 'url general escapes' '
 	test "$(test-urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
 '
 
-test_expect_success 'url high-bit escapes' '
+test_expect_success !MINGW 'url high-bit escapes' '
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-3")")" = "x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F" &&
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 3/6] MinGW: disable legacy encoding tests
  2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
  2014-07-17 15:37               ` [PATCH 1/6] MinGW: Skip test redirecting to fd 4 Stepan Kasal
  2014-07-17 15:37               ` [PATCH 2/6] Disable t0110's high-bit test on Windows Stepan Kasal
@ 2014-07-17 15:37               ` Stepan Kasal
  2014-07-17 15:37               ` [PATCH 4/6] t4210: skip command-line encoding tests on mingw Stepan Kasal
                                 ` (2 subsequent siblings)
  5 siblings, 0 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-17 15:37 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit,
	Karsten Blees, Stepan Kasal

From: Karsten Blees <blees@dcon.de>

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>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 t/t3901-i18n-patch.sh | 19 +++++++++++--------
 t/t4201-shortlog.sh   |  6 +++---
 t/t8005-blame-i18n.sh |  8 ++++----
 3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index 31a5770..55c8a2f 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -54,10 +54,13 @@ test_expect_success setup '
 	git add yours &&
 	git commit -s -m "Second on side" &&
 
-	# the second one on the side branch is ISO-8859-1
-	git config i18n.commitencoding ISO8859-1 &&
-	# use author and committer name in ISO-8859-1 to match it.
-	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
+	if test_have_prereq NOT_MINGW
+	then
+		# the second one on the side branch is ISO-8859-1
+		git config i18n.commitencoding ISO8859-1 &&
+		# use author and committer name in ISO-8859-1 to match it.
+		. "$TEST_DIRECTORY"/t3901-8859-1.txt
+	fi &&
 	test_tick &&
 	echo Yet another >theirs &&
 	git add theirs &&
@@ -119,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
 	check_encoding 2
 '
 
-test_expect_success 'rebase (L/L)' '
+test_expect_success NOT_MINGW 'rebase (L/L)' '
 	# In this test we want ISO-8859-1 encoded commits as the result
 	git config i18n.commitencoding ISO8859-1 &&
 	git config i18n.logoutputencoding ISO8859-1 &&
@@ -131,7 +134,7 @@ test_expect_success 'rebase (L/L)' '
 	check_encoding 2 8859
 '
 
-test_expect_success 'rebase (L/U)' '
+test_expect_success NOT_MINGW 'rebase (L/U)' '
 	# This is pathological -- use UTF-8 as intermediate form
 	# to get ISO-8859-1 results.
 	git config i18n.commitencoding ISO8859-1 &&
@@ -159,7 +162,7 @@ test_expect_success 'cherry-pick(U/U)' '
 	check_encoding 3
 '
 
-test_expect_success 'cherry-pick(L/L)' '
+test_expect_success NOT_MINGW 'cherry-pick(L/L)' '
 	# Both the commitencoding and logoutputencoding is set to ISO-8859-1
 
 	git config i18n.commitencoding ISO8859-1 &&
@@ -189,7 +192,7 @@ test_expect_success 'cherry-pick(U/L)' '
 	check_encoding 3
 '
 
-test_expect_success 'cherry-pick(L/U)' '
+test_expect_success NOT_MINGW 'cherry-pick(L/U)' '
 	# Again, the commitencoding is set to ISO-8859-1 but
 	# logoutputencoding is set to UTF-8.
 
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 97fcb31..565c020 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
 	test_cmp expect log.predictable
 '
 
-test_expect_success 'shortlog wrapping' '
+test_expect_success NOT_MINGW 'shortlog wrapping' '
 	cat >expect <<\EOF &&
 A U Thor (5):
       Test
@@ -114,7 +114,7 @@ EOF
 	test_cmp expect out
 '
 
-test_expect_success 'shortlog from non-git directory' '
+test_expect_success NOT_MINGW 'shortlog from non-git directory' '
 	git log HEAD >log &&
 	GIT_DIR=non-existing git shortlog -w <log >out &&
 	test_cmp expect out
@@ -159,7 +159,7 @@ $DSCHO (2):
 
 EOF
 
-test_expect_success 'shortlog encoding' '
+test_expect_success NOT_MINGW 'shortlog encoding' '
 	git reset --hard "$commit" &&
 	git config --unset i18n.commitencoding &&
 	echo 2 > a1 &&
diff --git a/t/t8005-blame-i18n.sh b/t/t8005-blame-i18n.sh
index cb39055..a6e73d0 100755
--- a/t/t8005-blame-i18n.sh
+++ b/t/t8005-blame-i18n.sh
@@ -33,7 +33,7 @@ author $SJIS_NAME
 summary $SJIS_MSG
 EOF
 
-test_expect_success \
+test_expect_success NOT_MINGW \
 	'blame respects i18n.commitencoding' '
 	git blame --incremental file | \
 		egrep "^(author|summary) " > actual &&
@@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME
 summary $EUC_JAPAN_MSG
 EOF
 
-test_expect_success \
+test_expect_success NOT_MINGW \
 	'blame respects i18n.logoutputencoding' '
 	git config i18n.logoutputencoding eucJP &&
 	git blame --incremental file | \
@@ -66,7 +66,7 @@ author $UTF8_NAME
 summary $UTF8_MSG
 EOF
 
-test_expect_success \
+test_expect_success NOT_MINGW \
 	'blame respects --encoding=UTF-8' '
 	git blame --incremental --encoding=UTF-8 file | \
 		egrep "^(author|summary) " > actual &&
@@ -82,7 +82,7 @@ author $UTF8_NAME
 summary $UTF8_MSG
 EOF
 
-test_expect_success \
+test_expect_success NOT_MINGW \
 	'blame respects --encoding=none' '
 	git blame --incremental --encoding=none file | \
 		egrep "^(author|summary) " > actual &&
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 4/6] t4210: skip command-line encoding tests on mingw
  2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
                                 ` (2 preceding siblings ...)
  2014-07-17 15:37               ` [PATCH 3/6] MinGW: disable legacy encoding tests Stepan Kasal
@ 2014-07-17 15:37               ` Stepan Kasal
  2014-07-18  9:52                 ` Erik Faye-Lund
  2014-07-17 15:37               ` [PATCH 5/6] t9902: mingw-specific fix for gitfile link files Stepan Kasal
  2014-07-17 15:37               ` [PATCH 6/6] t800[12]: work around MSys limitation Stepan Kasal
  5 siblings, 1 reply; 46+ messages in thread
From: Stepan Kasal @ 2014-07-17 15:37 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit,
	Pat Thoyts, Stepan Kasal

From: Pat Thoyts <patthoyts@users.sourceforge.net>

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>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 t/t4210-log-i18n.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh
index 52a7472..9110404 100755
--- a/t/t4210-log-i18n.sh
+++ b/t/t4210-log-i18n.sh
@@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
 	test_cmp expect actual
 '
 
-test_expect_success 'log --grep searches in log output encoding (latin1)' '
+test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' '
 	cat >expect <<-\EOF &&
 	latin1
 	utf8
@@ -43,7 +43,7 @@ test_expect_success 'log --grep searches in log output encoding (latin1)' '
 	test_cmp expect actual
 '
 
-test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
+test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' '
 	>expect &&
 	git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
 	test_cmp expect actual
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 5/6] t9902: mingw-specific fix for gitfile link files
  2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
                                 ` (3 preceding siblings ...)
  2014-07-17 15:37               ` [PATCH 4/6] t4210: skip command-line encoding tests on mingw Stepan Kasal
@ 2014-07-17 15:37               ` Stepan Kasal
  2014-07-17 20:42                 ` Junio C Hamano
  2014-07-17 15:37               ` [PATCH 6/6] t800[12]: work around MSys limitation Stepan Kasal
  5 siblings, 1 reply; 46+ messages in thread
From: Stepan Kasal @ 2014-07-17 15:37 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit,
	Pat Thoyts, Stepan Kasal

From: Pat Thoyts <patthoyts@users.sourceforge.net>

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>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 t/t9902-completion.sh | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 1d1c106..f10a752 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -212,9 +212,18 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' '
 	)
 '
 
+function pwd_P_W () {
+	if test_have_prereq MINGW
+	then
+		pwd -W
+	else
+		pwd -P
+	fi
+}
+
 test_expect_success '__gitdir - gitfile in cwd' '
-	echo "$(pwd -P)/otherrepo/.git" >expected &&
-	echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
+	echo "$(pwd_P_W)/otherrepo/.git" >expected &&
+	echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
 	test_when_finished "rm -f subdir/.git" &&
 	(
 		cd subdir &&
@@ -224,8 +233,8 @@ test_expect_success '__gitdir - gitfile in cwd' '
 '
 
 test_expect_success '__gitdir - gitfile in parent' '
-	echo "$(pwd -P)/otherrepo/.git" >expected &&
-	echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
+	echo "$(pwd_P_W)/otherrepo/.git" >expected &&
+	echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
 	test_when_finished "rm -f subdir/.git" &&
 	(
 		cd subdir/subsubdir &&
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 6/6] t800[12]: work around MSys limitation
  2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
                                 ` (4 preceding siblings ...)
  2014-07-17 15:37               ` [PATCH 5/6] t9902: mingw-specific fix for gitfile link files Stepan Kasal
@ 2014-07-17 15:37               ` Stepan Kasal
  5 siblings, 0 replies; 46+ messages in thread
From: Stepan Kasal @ 2014-07-17 15:37 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit,
	Karsten Blees, Johannes Schindelin, Stepan Kasal

From: Karsten Blees <blees@dcon.de>

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.)

The -L mangling can be done by the script, just before the parameter is
passed to the executable.  This version does not modify the body of the
tests and is active on MinGW only.

Commit-message-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Author: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 t/annotate-tests.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 304c7b7..071e4d7 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -1,6 +1,17 @@
 # This file isn't used as a test script directly, instead it is
 # sourced from t8001-annotate.sh and t8002-blame.sh.
 
+if test_have_prereq MINGW
+then
+  sanitize_L () {
+	echo "$1" | sed 'sX\(^-L\|,\)\^\?/X&\\;*Xg'
+  }
+else
+  sanitize_L () {
+	echo "$1"
+  }
+fi
+
 check_count () {
 	head= &&
 	file='file' &&
@@ -10,6 +21,7 @@ check_count () {
 		case "$1" in
 		-h) head="$2"; shift; shift ;;
 		-f) file="$2"; shift; shift ;;
+		-L*) options="$options $(sanitize_L "$1")"; shift ;;
 		-*) options="$options $1"; shift ;;
 		*) break ;;
 		esac
-- 
2.0.0.9635.g0be03cb

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH 2/6] Disable t0110's high-bit test on Windows
  2014-07-17 15:37               ` [PATCH 2/6] Disable t0110's high-bit test on Windows Stepan Kasal
@ 2014-07-17 18:20                 ` Karsten Blees
  2014-07-18 18:26                   ` Junio C Hamano
  0 siblings, 1 reply; 46+ messages in thread
From: Karsten Blees @ 2014-07-17 18:20 UTC (permalink / raw)
  To: Stepan Kasal
  Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list, msysGit,
	Johannes Schindelin

Am 17.07.2014 17:37, schrieb Stepan Kasal:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> 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.
> 

The description is not entirely correct...the Unicode-enabled MSYS.dll
expects the command line to be UTF-8. Only *invalid* UTF-8 is converted
to hex code for convenience. So its not the high bits that cause trouble,
but specifying 0x80 without proper UTF-8 lead byte.

I believe the last line of the test may actually work:

test "$(test-urlmatch-normalization -p "$(cat "$tu-11")")" = "x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD"

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4
  2014-07-17 15:37               ` [PATCH 1/6] MinGW: Skip test redirecting to fd 4 Stepan Kasal
@ 2014-07-17 18:41                 ` Junio C Hamano
  2014-07-17 20:06                   ` Johannes Schindelin
  2014-07-17 20:18                   ` Karsten Blees
  0 siblings, 2 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-17 18:41 UTC (permalink / raw)
  To: Stepan Kasal
  Cc: Karsten Blees, Johannes Sixt, GIT Mailing-list, msysGit,
	Johannes Schindelin

Stepan Kasal <kasal@ucw.cz> writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> ... because that does not work in MinGW.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Stepan Kasal <kasal@ucw.cz>
> ---
>  t/t0081-line-buffer.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
> index bd83ed3..25dba00 100755
> --- a/t/t0081-line-buffer.sh
> +++ b/t/t0081-line-buffer.sh
> @@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
>  	test_cmp expect actual
>  '
>  
> -test_expect_success 'read from file descriptor' '
> +test_expect_success NOT_MINGW 'read from file descriptor' '
>  	rm -f input &&
>  	echo hello >expect &&
>  	echo hello >input &&

Hmm, the point of this test seems to be to exercise buffer_fdinit(),
instead of buffer_init(), and the file descriptor does not have to
be "4" for the purpose of the test, no?

Is what is broken on MinGW redirecting arbitrary file descrptors?
If that is not the case, wouldn't the following a good enough (or
better) replacement, I wonder?

 t/t0081-line-buffer.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
index bd83ed3..881789a 100755
--- a/t/t0081-line-buffer.sh
+++ b/t/t0081-line-buffer.sh
@@ -34,7 +34,6 @@ test_expect_success 'read from file descriptor' '
 	echo hello >expect &&
 	echo hello >input &&
-	echo copy 6 |
-	test-line-buffer "&4" 4<input >actual &&
+	test-line-buffer "&0" <input >actual &&
 	test_cmp expect actual
 '
 

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4
  2014-07-17 18:41                 ` Junio C Hamano
@ 2014-07-17 20:06                   ` Johannes Schindelin
  2014-07-17 20:18                   ` Karsten Blees
  1 sibling, 0 replies; 46+ messages in thread
From: Johannes Schindelin @ 2014-07-17 20:06 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Stepan Kasal, Karsten Blees, Johannes Sixt, GIT Mailing-list, msysGit

Hi Junio,

On Thu, 17 Jul 2014, Junio C Hamano wrote:

> Is what is broken on MinGW redirecting arbitrary file descrptors?

IIRC that was exactly the problem.

> diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
> index bd83ed3..881789a 100755
> --- a/t/t0081-line-buffer.sh
> +++ b/t/t0081-line-buffer.sh
> @@ -34,7 +34,6 @@ test_expect_success 'read from file descriptor' '
>  	echo hello >expect &&
>  	echo hello >input &&
> -	echo copy 6 |
> -	test-line-buffer "&4" 4<input >actual &&
> +	test-line-buffer "&0" <input >actual &&
>  	test_cmp expect actual
>  '

I will test this later, and also try to wrap my head around the details of
the problem.

Thank you so much!
Johannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4
  2014-07-17 18:41                 ` Junio C Hamano
  2014-07-17 20:06                   ` Johannes Schindelin
@ 2014-07-17 20:18                   ` Karsten Blees
  2014-07-17 20:38                     ` Junio C Hamano
  1 sibling, 1 reply; 46+ messages in thread
From: Karsten Blees @ 2014-07-17 20:18 UTC (permalink / raw)
  To: Junio C Hamano, Stepan Kasal
  Cc: Johannes Sixt, GIT Mailing-list, msysGit, Johannes Schindelin

Am 17.07.2014 20:41, schrieb Junio C Hamano:
> Stepan Kasal <kasal@ucw.cz> writes:
> 
>> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>>
>> ... because that does not work in MinGW.
>>
>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>> Signed-off-by: Stepan Kasal <kasal@ucw.cz>
>> ---
>>  t/t0081-line-buffer.sh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
>> index bd83ed3..25dba00 100755
>> --- a/t/t0081-line-buffer.sh
>> +++ b/t/t0081-line-buffer.sh
>> @@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
>>  	test_cmp expect actual
>>  '
>>  
>> -test_expect_success 'read from file descriptor' '
>> +test_expect_success NOT_MINGW 'read from file descriptor' '
>>  	rm -f input &&
>>  	echo hello >expect &&
>>  	echo hello >input &&
> 
> Hmm, the point of this test seems to be to exercise buffer_fdinit(),
> instead of buffer_init(), and the file descriptor does not have to
> be "4" for the purpose of the test, no?
> 
> Is what is broken on MinGW redirecting arbitrary file descrptors?

Yes. 0, 1 and 2 work (vie GetStdHandle), but anything else is handled
by the C-runtime. And as MSYS.dll (bash) and MSVCRT.dll (git) do it in
different ways, it doesn't work.

> -	echo copy 6 |
> -	test-line-buffer "&4" 4<input >actual &&
> +	test-line-buffer "&0" <input >actual &&

test-line-buffer already reads commands ("copy 6") from stdin, so stdin cannot
be reused for the data stream, unfortunately.

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4
  2014-07-17 20:18                   ` Karsten Blees
@ 2014-07-17 20:38                     ` Junio C Hamano
  0 siblings, 0 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-17 20:38 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit,
	Johannes Schindelin

Karsten Blees <karsten.blees@gmail.com> writes:

> Yes. 0, 1 and 2 work (vie GetStdHandle), but anything else is handled
> by the C-runtime. And as MSYS.dll (bash) and MSVCRT.dll (git) do it in
> different ways, it doesn't work.
>
>> -	echo copy 6 |
>> -	test-line-buffer "&4" 4<input >actual &&
>> +	test-line-buffer "&0" <input >actual &&
>
> test-line-buffer already reads commands ("copy 6") from stdin, so stdin cannot
> be reused for the data stream, unfortunately.

Sorry, that was my silly.

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 5/6] t9902: mingw-specific fix for gitfile link files
  2014-07-17 15:37               ` [PATCH 5/6] t9902: mingw-specific fix for gitfile link files Stepan Kasal
@ 2014-07-17 20:42                 ` Junio C Hamano
  0 siblings, 0 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-17 20:42 UTC (permalink / raw)
  To: Stepan Kasal
  Cc: Karsten Blees, Johannes Sixt, GIT Mailing-list, msysGit, Pat Thoyts

Stepan Kasal <kasal@ucw.cz> writes:

> From: Pat Thoyts <patthoyts@users.sourceforge.net>
>
> 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 /.

OK.   We seem to have uses of "pwd -P" in other tests; don't they
need a similar treatment, and if not why not?

>
> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
> Signed-off-by: Stepan Kasal <kasal@ucw.cz>
> ---
>  t/t9902-completion.sh | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
> index 1d1c106..f10a752 100755
> --- a/t/t9902-completion.sh
> +++ b/t/t9902-completion.sh
> @@ -212,9 +212,18 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' '
>  	)
>  '
>  
> +function pwd_P_W () {
> +	if test_have_prereq MINGW
> +	then
> +		pwd -W
> +	else
> +		pwd -P
> +	fi
> +}
> +
>  test_expect_success '__gitdir - gitfile in cwd' '
> -	echo "$(pwd -P)/otherrepo/.git" >expected &&
> -	echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
> +	echo "$(pwd_P_W)/otherrepo/.git" >expected &&
> +	echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
>  	test_when_finished "rm -f subdir/.git" &&
>  	(
>  		cd subdir &&
> @@ -224,8 +233,8 @@ test_expect_success '__gitdir - gitfile in cwd' '
>  '
>  
>  test_expect_success '__gitdir - gitfile in parent' '
> -	echo "$(pwd -P)/otherrepo/.git" >expected &&
> -	echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
> +	echo "$(pwd_P_W)/otherrepo/.git" >expected &&
> +	echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
>  	test_when_finished "rm -f subdir/.git" &&
>  	(
>  		cd subdir/subsubdir &&
> -- 
> 2.0.0.9635.g0be03cb
>
> -- 

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
  2014-07-17 15:37               ` [PATCH 4/6] t4210: skip command-line encoding tests on mingw Stepan Kasal
@ 2014-07-18  9:52                 ` Erik Faye-Lund
  2014-07-21 16:59                   ` Junio C Hamano
  0 siblings, 1 reply; 46+ messages in thread
From: Erik Faye-Lund @ 2014-07-18  9:52 UTC (permalink / raw)
  To: Stepan Kasal
  Cc: Karsten Blees, Junio C Hamano, Johannes Sixt, GIT Mailing-list,
	msysGit, Pat Thoyts

On Thu, Jul 17, 2014 at 5:37 PM, Stepan Kasal <kasal@ucw.cz> wrote:
> From: Pat Thoyts <patthoyts@users.sourceforge.net>
>
> 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>
> Signed-off-by: Stepan Kasal <kasal@ucw.cz>
> ---
>  t/t4210-log-i18n.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh
> index 52a7472..9110404 100755
> --- a/t/t4210-log-i18n.sh
> +++ b/t/t4210-log-i18n.sh
> @@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
>         test_cmp expect actual
>  '
>
> -test_expect_success 'log --grep searches in log output encoding (latin1)' '
> +test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' '
>         cat >expect <<-\EOF &&
>         latin1
>         utf8
> @@ -43,7 +43,7 @@ test_expect_success 'log --grep searches in log output encoding (latin1)' '
>         test_cmp expect actual
>  '
>
> -test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
> +test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' '

Perhaps these checks would be more readable a few years in the future,
if we make a separate capability along the lines of
NON_UNICODE_LOCALE?

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 2/6] Disable t0110's high-bit test on Windows
  2014-07-17 18:20                 ` Karsten Blees
@ 2014-07-18 18:26                   ` Junio C Hamano
  2014-07-19 19:37                     ` [PATCH] t0110/MinGW: skip tests that pass arbitrary bytes on the command line Karsten Blees
  0 siblings, 1 reply; 46+ messages in thread
From: Junio C Hamano @ 2014-07-18 18:26 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit,
	Johannes Schindelin

Karsten Blees <karsten.blees@gmail.com> writes:

> Am 17.07.2014 17:37, schrieb Stepan Kasal:
>> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>> 
>> 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.
>> 
>
> The description is not entirely correct...the Unicode-enabled MSYS.dll
> expects the command line to be UTF-8. Only *invalid* UTF-8 is converted
> to hex code for convenience. So its not the high bits that cause trouble,
> but specifying 0x80 without proper UTF-8 lead byte.
>
> I believe the last line of the test may actually work:
>
> test "$(test-urlmatch-normalization -p "$(cat "$tu-11")")" = "x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD"
>
> -- 

Can somebody send a tested replacement then?

Thanks.

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH] t0110/MinGW: skip tests that pass arbitrary bytes on the command line
  2014-07-18 18:26                   ` Junio C Hamano
@ 2014-07-19 19:37                     ` Karsten Blees
  2014-07-21 16:41                       ` Junio C Hamano
  0 siblings, 1 reply; 46+ messages in thread
From: Karsten Blees @ 2014-07-19 19:37 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit,
	Johannes Schindelin

On Windows, the command line is a Unicode string, it is not possible to
pass arbitrary bytes to a program. Disable tests that try to do so.

Signed-off-by: Karsten Blees <blees@dcon.de>
---
 t/t0110-urlmatch-normalization.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/t/t0110-urlmatch-normalization.sh b/t/t0110-urlmatch-normalization.sh
index 8d6096d..410d576 100755
--- a/t/t0110-urlmatch-normalization.sh
+++ b/t/t0110-urlmatch-normalization.sh
@@ -117,7 +117,7 @@ test_expect_success 'url general escapes' '
 	test "$(test-urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
 '
 
-test_expect_success 'url high-bit escapes' '
+test_expect_success !MINGW 'url high-bit escapes' '
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-3")")" = "x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F" &&
@@ -127,7 +127,10 @@ test_expect_success 'url high-bit escapes' '
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-7")")" = "x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF" &&
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-8")")" = "x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF" &&
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-9")")" = "x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF" &&
-	test "$(test-urlmatch-normalization -p "$(cat "$tu-10")")" = "x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF" &&
+	test "$(test-urlmatch-normalization -p "$(cat "$tu-10")")" = "x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF"
+'
+
+test_expect_success 'url utf-8 escapes' '
 	test "$(test-urlmatch-normalization -p "$(cat "$tu-11")")" = "x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD"
 '
 
-- 
2.0.2.906.g50cb2fc.dirty

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH] t0110/MinGW: skip tests that pass arbitrary bytes on the command line
  2014-07-19 19:37                     ` [PATCH] t0110/MinGW: skip tests that pass arbitrary bytes on the command line Karsten Blees
@ 2014-07-21 16:41                       ` Junio C Hamano
  0 siblings, 0 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-21 16:41 UTC (permalink / raw)
  To: Karsten Blees
  Cc: Stepan Kasal, Johannes Sixt, GIT Mailing-list, msysGit,
	Johannes Schindelin

Karsten Blees <karsten.blees@gmail.com> writes:

> On Windows, the command line is a Unicode string, it is not possible to
> pass arbitrary bytes to a program. Disable tests that try to do so.
>
> Signed-off-by: Karsten Blees <blees@dcon.de>
> ---

Thanks; will replace.

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
  2014-07-18  9:52                 ` Erik Faye-Lund
@ 2014-07-21 16:59                   ` Junio C Hamano
  2014-07-21 17:45                     ` Johannes Schindelin
  2014-07-21 20:07                     ` Junio C Hamano
  0 siblings, 2 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-21 16:59 UTC (permalink / raw)
  To: kusmabite
  Cc: Stepan Kasal, Karsten Blees, Johannes Sixt, GIT Mailing-list,
	msysGit, Pat Thoyts

Erik Faye-Lund <kusmabite@gmail.com> writes:

> On Thu, Jul 17, 2014 at 5:37 PM, Stepan Kasal <kasal@ucw.cz> wrote:
>> From: Pat Thoyts <patthoyts@users.sourceforge.net>
>>
>> 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.
>> ...
>> -test_expect_success 'log --grep searches in log output encoding (latin1)' '
>> +test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' '
>>         cat >expect <<-\EOF &&
>>         latin1
>>         utf8
>> @@ -43,7 +43,7 @@ test_expect_success 'log --grep searches in log output encoding (latin1)' '
>>         test_cmp expect actual
>>  '
>>
>> -test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
>> +test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' '
>
> Perhaps these checks would be more readable a few years in the future,
> if we make a separate capability along the lines of
> NON_UNICODE_LOCALE?

I do agree that having "unicode" and possibly also "locale" and
dropping "mingw" from the prerequisite makes sense, especially in
the longer term.  Please make it so _after_ the dust settles.

I however suspect that NON_UNICODE_LOCALE does not read quite well;
isn't the trouble that mingw allows nothing but unicode strings on
the command line (there is no trouble for non unicode strings that
appear as payload)?

Oh by the way, can somebody remind me why we spell these as
NOT_MINGW,  instead of !MINGW?




-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
  2014-07-21 16:59                   ` Junio C Hamano
@ 2014-07-21 17:45                     ` Johannes Schindelin
  2014-07-21 19:21                       ` Johannes Sixt
  2014-07-21 20:07                     ` Junio C Hamano
  1 sibling, 1 reply; 46+ messages in thread
From: Johannes Schindelin @ 2014-07-21 17:45 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: kusmabite, Stepan Kasal, Karsten Blees, Johannes Sixt,
	GIT Mailing-list, msysGit, Pat Thoyts

Hi Junio,

On Mon, 21 Jul 2014, Junio C Hamano wrote:

> Oh by the way, can somebody remind me why we spell these as
> NOT_MINGW,  instead of !MINGW?

I guess that is my mistake; when I introduced the use of NOT_MINGW I was
simply unaware of the !MINGW syntax.

Let's use the latter consistently?

Ciao,
Johannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
  2014-07-21 17:45                     ` Johannes Schindelin
@ 2014-07-21 19:21                       ` Johannes Sixt
  0 siblings, 0 replies; 46+ messages in thread
From: Johannes Sixt @ 2014-07-21 19:21 UTC (permalink / raw)
  To: Johannes Schindelin, Junio C Hamano
  Cc: kusmabite, Stepan Kasal, Karsten Blees, GIT Mailing-list,
	msysGit, Pat Thoyts

Am 21.07.2014 19:45, schrieb Johannes Schindelin:
> Hi Junio,
> 
> On Mon, 21 Jul 2014, Junio C Hamano wrote:
> 
>> Oh by the way, can somebody remind me why we spell these as
>> NOT_MINGW,  instead of !MINGW?
> 
> I guess that is my mistake; when I introduced the use of NOT_MINGW I was
> simply unaware of the !MINGW syntax.

You can hardly be blamed. The first occurrence of NOT_MINGW was added
much earlier than the ability to negate prerequisite tokens.

> Let's use the latter consistently?

Of course!

-- Hannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
  2014-07-21 16:59                   ` Junio C Hamano
  2014-07-21 17:45                     ` Johannes Schindelin
@ 2014-07-21 20:07                     ` Junio C Hamano
  2014-07-21 22:29                       ` Junio C Hamano
  2014-07-21 22:30                       ` [PATCH 2/2] test prerequisites: enumerate with commas Junio C Hamano
  1 sibling, 2 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-21 20:07 UTC (permalink / raw)
  To: kusmabite
  Cc: Stepan Kasal, Karsten Blees, Johannes Sixt, GIT Mailing-list,
	msysGit, Pat Thoyts

Junio C Hamano <gitster@pobox.com> writes:

> Oh by the way, can somebody remind me why we spell these as
> NOT_MINGW,  instead of !MINGW?

Simple answer seems to be that !ANYTHING appeared only at bdccd3c1
(test-lib: allow negation of prerequisites, 2012-11-14) but at that
version already 5 test files use NOT_MINGW (and a few MINGW) as
prerequisites.  We can safely replace uses of NOT_MINGW prerequisite
with !MINGW, it seems.

Sorry for the noise.


-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
  2014-07-21 20:07                     ` Junio C Hamano
@ 2014-07-21 22:29                       ` Junio C Hamano
  2014-07-21 22:39                         ` Junio C Hamano
  2014-07-21 22:30                       ` [PATCH 2/2] test prerequisites: enumerate with commas Junio C Hamano
  1 sibling, 1 reply; 46+ messages in thread
From: Junio C Hamano @ 2014-07-21 22:29 UTC (permalink / raw)
  To: kusmabite
  Cc: Stepan Kasal, Karsten Blees, Johannes Sixt, GIT Mailing-list,
	msysGit, Pat Thoyts

Junio C Hamano <gitster@pobox.com> writes:

> Junio C Hamano <gitster@pobox.com> writes:
>
>> Oh by the way, can somebody remind me why we spell these as
>> NOT_MINGW,  instead of !MINGW?
>
> Simple answer seems to be that !ANYTHING appeared only at bdccd3c1
> (test-lib: allow negation of prerequisites, 2012-11-14) but at that
> version already 5 test files use NOT_MINGW (and a few MINGW) as
> prerequisites.  We can safely replace uses of NOT_MINGW prerequisite
> with !MINGW, it seems.
>
> Sorry for the noise.

So here is the first of the two small/trivial patch series. 

To prepare the first one, I did "git grep -e '\<NOT_' t/" to the
result of applying Stepan's series and edited the hits manually.
And then compared the result with running

 $ perl -p -i -e 'if (!/\btest_set_prereq\s/) {
       s/\bNOT_([A-Z]*)\b/!$1/g
   }' t/t*.sh

on Stepan's series to see if I missed anything.

The second one was discovered while doing the manual fix mentioned
above.

-- >8 --
Subject: [PATCH 1/2] test prerequisites: eradicate NOT_FOO

Support for Back when bdccd3c1 (test-lib: allow negation of
prerequisites, 2012-11-14) introduced negated predicates
(e.g. "!MINGW,!CYGWIN"), we already had 5 test files that use
NOT_MINGW (and a few MINGW) as prerequisites.

Let's not add NOT_FOO and rewrite existing ones as !FOO for both
MINGW and CYGWIN.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t0008-ignores.sh            |  2 +-
 t/t0081-line-buffer.sh        |  2 +-
 t/t1020-subdirectory.sh       |  2 +-
 t/t1300-repo-config.sh        |  6 +++---
 t/t1402-check-ref-format.sh   | 32 ++++++++++++++++----------------
 t/t3901-i18n-patch.sh         | 10 +++++-----
 t/t4201-shortlog.sh           |  6 +++---
 t/t4210-log-i18n.sh           |  4 ++--
 t/t5601-clone.sh              |  4 ++--
 t/t8005-blame-i18n.sh         |  8 ++++----
 t/t9300-fast-import.sh        |  8 ++++----
 t/t9809-git-p4-client-view.sh |  4 ++--
 t/t9812-git-p4-wildcards.sh   | 14 +++++++-------
 t/t9815-git-p4-submit-fail.sh |  2 +-
 t/test-lib.sh                 |  4 ----
 15 files changed, 52 insertions(+), 56 deletions(-)

diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 39e55a1..8dc6939 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -806,7 +806,7 @@ test_expect_success !MINGW 'quoting allows trailing whitespace' '
 	test_cmp err.expect err
 '
 
-test_expect_success NOT_MINGW,NOT_CYGWIN 'correct handling of backslashes' '
+test_expect_success !MINGW,!CYGWIN 'correct handling of backslashes' '
 	rm -rf whitespace &&
 	mkdir whitespace &&
 	>"whitespace/trailing 1  " &&
diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
index 25dba00..ce92e6a 100755
--- a/t/t0081-line-buffer.sh
+++ b/t/t0081-line-buffer.sh
@@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
 	test_cmp expect actual
 '
 
-test_expect_success NOT_MINGW 'read from file descriptor' '
+test_expect_success !MINGW 'read from file descriptor' '
 	rm -f input &&
 	echo hello >expect &&
 	echo hello >input &&
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh
index 62c0d25..2edb4f2 100755
--- a/t/t1020-subdirectory.sh
+++ b/t/t1020-subdirectory.sh
@@ -118,7 +118,7 @@ test_expect_success 'alias expansion' '
 	)
 '
 
-test_expect_success NOT_MINGW '!alias expansion' '
+test_expect_success !MINGW '!alias expansion' '
 	pwd >expect &&
 	(
 		git config alias.test-alias-directory !pwd &&
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 3f80ff0..fb871d0 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -824,14 +824,14 @@ cat >expect <<\EOF
 	trailingtilde = foo~
 EOF
 
-test_expect_success NOT_MINGW 'set --path' '
+test_expect_success !MINGW 'set --path' '
 	rm -f .git/config &&
 	git config --path path.home "~/" &&
 	git config --path path.normal "/dev/null" &&
 	git config --path path.trailingtilde "foo~" &&
 	test_cmp expect .git/config'
 
-if test_have_prereq NOT_MINGW && test "${HOME+set}"
+if test_have_prereq !MINGW && test "${HOME+set}"
 then
 	test_set_prereq HOMEVAR
 fi
@@ -854,7 +854,7 @@ cat >expect <<\EOF
 foo~
 EOF
 
-test_expect_success NOT_MINGW 'get --path copes with unset $HOME' '
+test_expect_success !MINGW 'get --path copes with unset $HOME' '
 	(
 		unset HOME;
 		test_must_fail git config --get --path path.home \
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index 9aeb352..72fd917 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -30,17 +30,17 @@ invalid_ref() {
 }
 
 invalid_ref ''
-invalid_ref NOT_MINGW '/'
-invalid_ref NOT_MINGW '/' --allow-onelevel
-invalid_ref NOT_MINGW '/' --normalize
-invalid_ref NOT_MINGW '/' '--allow-onelevel --normalize'
+invalid_ref !MINGW '/'
+invalid_ref !MINGW '/' --allow-onelevel
+invalid_ref !MINGW '/' --normalize
+invalid_ref !MINGW '/' '--allow-onelevel --normalize'
 valid_ref 'foo/bar/baz'
 valid_ref 'foo/bar/baz' --normalize
 invalid_ref 'refs///heads/foo'
 valid_ref 'refs///heads/foo' --normalize
 invalid_ref 'heads/foo/'
-invalid_ref NOT_MINGW '/heads/foo'
-valid_ref NOT_MINGW '/heads/foo' --normalize
+invalid_ref !MINGW '/heads/foo'
+valid_ref !MINGW '/heads/foo' --normalize
 invalid_ref '///heads/foo'
 valid_ref '///heads/foo' --normalize
 invalid_ref './foo'
@@ -120,14 +120,14 @@ invalid_ref "$ref" --refspec-pattern
 invalid_ref "$ref" '--refspec-pattern --allow-onelevel'
 
 ref='/foo'
-invalid_ref NOT_MINGW "$ref"
-invalid_ref NOT_MINGW "$ref" --allow-onelevel
-invalid_ref NOT_MINGW "$ref" --refspec-pattern
-invalid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel'
-invalid_ref NOT_MINGW "$ref" --normalize
-valid_ref NOT_MINGW "$ref" '--allow-onelevel --normalize'
-invalid_ref NOT_MINGW "$ref" '--refspec-pattern --normalize'
-valid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
+invalid_ref !MINGW "$ref"
+invalid_ref !MINGW "$ref" --allow-onelevel
+invalid_ref !MINGW "$ref" --refspec-pattern
+invalid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel'
+invalid_ref !MINGW "$ref" --normalize
+valid_ref !MINGW "$ref" '--allow-onelevel --normalize'
+invalid_ref !MINGW "$ref" '--refspec-pattern --normalize'
+valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
 
 
 valid_ref 'refs/heads/a-very-long-refname'
@@ -199,10 +199,10 @@ invalid_ref_normalized() {
 
 valid_ref_normalized 'heads/foo' 'heads/foo'
 valid_ref_normalized 'refs///heads/foo' 'refs/heads/foo'
-valid_ref_normalized NOT_MINGW '/heads/foo' 'heads/foo'
+valid_ref_normalized !MINGW '/heads/foo' 'heads/foo'
 valid_ref_normalized '///heads/foo' 'heads/foo'
 invalid_ref_normalized 'foo'
-invalid_ref_normalized NOT_MINGW '/foo'
+invalid_ref_normalized !MINGW '/foo'
 invalid_ref_normalized 'heads/foo/../bar'
 invalid_ref_normalized 'heads/./foo'
 invalid_ref_normalized 'heads\foo'
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index 55c8a2f..a392f3d 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -54,7 +54,7 @@ test_expect_success setup '
 	git add yours &&
 	git commit -s -m "Second on side" &&
 
-	if test_have_prereq NOT_MINGW
+	if test_have_prereq !MINGW
 	then
 		# the second one on the side branch is ISO-8859-1
 		git config i18n.commitencoding ISO8859-1 &&
@@ -122,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
 	check_encoding 2
 '
 
-test_expect_success NOT_MINGW 'rebase (L/L)' '
+test_expect_success !MINGW 'rebase (L/L)' '
 	# In this test we want ISO-8859-1 encoded commits as the result
 	git config i18n.commitencoding ISO8859-1 &&
 	git config i18n.logoutputencoding ISO8859-1 &&
@@ -134,7 +134,7 @@ test_expect_success NOT_MINGW 'rebase (L/L)' '
 	check_encoding 2 8859
 '
 
-test_expect_success NOT_MINGW 'rebase (L/U)' '
+test_expect_success !MINGW 'rebase (L/U)' '
 	# This is pathological -- use UTF-8 as intermediate form
 	# to get ISO-8859-1 results.
 	git config i18n.commitencoding ISO8859-1 &&
@@ -162,7 +162,7 @@ test_expect_success 'cherry-pick(U/U)' '
 	check_encoding 3
 '
 
-test_expect_success NOT_MINGW 'cherry-pick(L/L)' '
+test_expect_success !MINGW 'cherry-pick(L/L)' '
 	# Both the commitencoding and logoutputencoding is set to ISO-8859-1
 
 	git config i18n.commitencoding ISO8859-1 &&
@@ -192,7 +192,7 @@ test_expect_success 'cherry-pick(U/L)' '
 	check_encoding 3
 '
 
-test_expect_success NOT_MINGW 'cherry-pick(L/U)' '
+test_expect_success !MINGW 'cherry-pick(L/U)' '
 	# Again, the commitencoding is set to ISO-8859-1 but
 	# logoutputencoding is set to UTF-8.
 
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 565c020..7600a3e 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
 	test_cmp expect log.predictable
 '
 
-test_expect_success NOT_MINGW 'shortlog wrapping' '
+test_expect_success !MINGW 'shortlog wrapping' '
 	cat >expect <<\EOF &&
 A U Thor (5):
       Test
@@ -114,7 +114,7 @@ EOF
 	test_cmp expect out
 '
 
-test_expect_success NOT_MINGW 'shortlog from non-git directory' '
+test_expect_success !MINGW 'shortlog from non-git directory' '
 	git log HEAD >log &&
 	GIT_DIR=non-existing git shortlog -w <log >out &&
 	test_cmp expect out
@@ -159,7 +159,7 @@ $DSCHO (2):
 
 EOF
 
-test_expect_success NOT_MINGW 'shortlog encoding' '
+test_expect_success !MINGW 'shortlog encoding' '
 	git reset --hard "$commit" &&
 	git config --unset i18n.commitencoding &&
 	echo 2 > a1 &&
diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh
index 9110404..e585fe6 100755
--- a/t/t4210-log-i18n.sh
+++ b/t/t4210-log-i18n.sh
@@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
 	test_cmp expect actual
 '
 
-test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' '
+test_expect_success !MINGW 'log --grep searches in log output encoding (latin1)' '
 	cat >expect <<-\EOF &&
 	latin1
 	utf8
@@ -43,7 +43,7 @@ test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin
 	test_cmp expect actual
 '
 
-test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' '
+test_expect_success !MINGW 'log --grep does not find non-reencoded values (utf8)' '
 	>expect &&
 	git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
 	test_cmp expect actual
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 5e67035..e4f10c0 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -318,7 +318,7 @@ test_expect_success 'clone myhost:src uses ssh' '
 	expect_ssh myhost src
 '
 
-test_expect_success NOT_MINGW,NOT_CYGWIN 'clone local path foo:bar' '
+test_expect_success !MINGW,!CYGWIN 'clone local path foo:bar' '
 	cp -R src "foo:bar" &&
 	git clone "foo:bar" foobar &&
 	expect_ssh none
@@ -339,7 +339,7 @@ test_clone_url () {
 	expect_ssh "$2" "$3"
 }
 
-test_expect_success NOT_MINGW 'clone c:temp is ssl' '
+test_expect_success !MINGW 'clone c:temp is ssl' '
 	test_clone_url c:temp c temp
 '
 
diff --git a/t/t8005-blame-i18n.sh b/t/t8005-blame-i18n.sh
index a6e73d0..847d098 100755
--- a/t/t8005-blame-i18n.sh
+++ b/t/t8005-blame-i18n.sh
@@ -33,7 +33,7 @@ author $SJIS_NAME
 summary $SJIS_MSG
 EOF
 
-test_expect_success NOT_MINGW \
+test_expect_success !MINGW \
 	'blame respects i18n.commitencoding' '
 	git blame --incremental file | \
 		egrep "^(author|summary) " > actual &&
@@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME
 summary $EUC_JAPAN_MSG
 EOF
 
-test_expect_success NOT_MINGW \
+test_expect_success !MINGW \
 	'blame respects i18n.logoutputencoding' '
 	git config i18n.logoutputencoding eucJP &&
 	git blame --incremental file | \
@@ -66,7 +66,7 @@ author $UTF8_NAME
 summary $UTF8_MSG
 EOF
 
-test_expect_success NOT_MINGW \
+test_expect_success !MINGW \
 	'blame respects --encoding=UTF-8' '
 	git blame --incremental --encoding=UTF-8 file | \
 		egrep "^(author|summary) " > actual &&
@@ -82,7 +82,7 @@ author $UTF8_NAME
 summary $UTF8_MSG
 EOF
 
-test_expect_success NOT_MINGW \
+test_expect_success !MINGW \
 	'blame respects --encoding=none' '
 	git blame --incremental --encoding=none file | \
 		egrep "^(author|summary) " > actual &&
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 5fc9ef2..99f5161 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -2336,7 +2336,7 @@ test_expect_success 'R: cat-blob-fd must be a nonnegative integer' '
 	test_must_fail git fast-import --cat-blob-fd=-1 </dev/null
 '
 
-test_expect_success NOT_MINGW 'R: print old blob' '
+test_expect_success !MINGW 'R: print old blob' '
 	blob=$(echo "yes it can" | git hash-object -w --stdin) &&
 	cat >expect <<-EOF &&
 	${blob} blob 11
@@ -2348,7 +2348,7 @@ test_expect_success NOT_MINGW 'R: print old blob' '
 	test_cmp expect actual
 '
 
-test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '
+test_expect_success !MINGW 'R: in-stream cat-blob-fd not respected' '
 	echo hello >greeting &&
 	blob=$(git hash-object -w greeting) &&
 	cat >expect <<-EOF &&
@@ -2369,7 +2369,7 @@ test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '
 	test_cmp expect actual.1
 '
 
-test_expect_success NOT_MINGW 'R: print new blob' '
+test_expect_success !MINGW 'R: print new blob' '
 	blob=$(echo "yep yep yep" | git hash-object --stdin) &&
 	cat >expect <<-EOF &&
 	${blob} blob 12
@@ -2387,7 +2387,7 @@ test_expect_success NOT_MINGW 'R: print new blob' '
 	test_cmp expect actual
 '
 
-test_expect_success NOT_MINGW 'R: print new blob by sha1' '
+test_expect_success !MINGW 'R: print new blob by sha1' '
 	blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
 	cat >expect <<-EOF &&
 	${blob} blob 25
diff --git a/t/t9809-git-p4-client-view.sh b/t/t9809-git-p4-client-view.sh
index 23a827f..e80db7a 100755
--- a/t/t9809-git-p4-client-view.sh
+++ b/t/t9809-git-p4-client-view.sh
@@ -365,7 +365,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
 	(
 		cd "$git" &&
 		echo git-wild-hash >dir1/git-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			echo git-wild-star >dir1/git-wild\*star
 		fi &&
@@ -379,7 +379,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
 	(
 		cd "$cli" &&
 		test_path_is_file dir1/git-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			test_path_is_file dir1/git-wild\*star
 		fi &&
diff --git a/t/t9812-git-p4-wildcards.sh b/t/t9812-git-p4-wildcards.sh
index c7472cb..ed4b488 100755
--- a/t/t9812-git-p4-wildcards.sh
+++ b/t/t9812-git-p4-wildcards.sh
@@ -14,7 +14,7 @@ test_expect_success 'add p4 files with wildcards in the names' '
 		printf "file2\nhas\nsome\nrandom\ntext\n" >file2 &&
 		p4 add file2 &&
 		echo file-wild-hash >file-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			echo file-wild-star >file-wild\*star
 		fi &&
@@ -31,7 +31,7 @@ test_expect_success 'wildcard files git p4 clone' '
 	(
 		cd "$git" &&
 		test -f file-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			test -f file-wild\*star
 		fi &&
@@ -46,7 +46,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
 	(
 		cd "$git" &&
 		echo git-wild-hash >git-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			echo git-wild-star >git-wild\*star
 		fi &&
@@ -60,7 +60,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
 	(
 		cd "$cli" &&
 		test_path_is_file git-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			test_path_is_file git-wild\*star
 		fi &&
@@ -75,7 +75,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
 	(
 		cd "$git" &&
 		echo new-line >>git-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			echo new-line >>git-wild\*star
 		fi &&
@@ -89,7 +89,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
 	(
 		cd "$cli" &&
 		test_line_count = 2 git-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			test_line_count = 2 git-wild\*star
 		fi &&
@@ -152,7 +152,7 @@ test_expect_success 'wildcard files submit back to p4, delete' '
 	(
 		cd "$cli" &&
 		test_path_is_missing git-wild#hash &&
-		if test_have_prereq NOT_MINGW NOT_CYGWIN
+		if test_have_prereq !MINGW !CYGWIN
 		then
 			test_path_is_missing git-wild\*star
 		fi &&
diff --git a/t/t9815-git-p4-submit-fail.sh b/t/t9815-git-p4-submit-fail.sh
index 1243d96..4cff6a7 100755
--- a/t/t9815-git-p4-submit-fail.sh
+++ b/t/t9815-git-p4-submit-fail.sh
@@ -417,7 +417,7 @@ test_expect_success 'cleanup chmod after submit cancel' '
 		! p4 fstat -T action text &&
 		test_path_is_file text+x &&
 		! p4 fstat -T action text+x &&
-		if test_have_prereq NOT_CYGWIN
+		if test_have_prereq !CYGWIN
 		then
 			stat --format=%A text | egrep ^-r-- &&
 			stat --format=%A text+x | egrep ^-r-x
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a479537..b72f6bd 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -866,7 +866,6 @@ case $(uname -s) in
 	# backslashes in pathspec are converted to '/'
 	# exec does not inherit the PID
 	test_set_prereq MINGW
-	test_set_prereq NOT_CYGWIN
 	test_set_prereq SED_STRIPS_CR
 	test_set_prereq GREP_STRIPS_CR
 	GIT_TEST_CMP=mingw_test_cmp
@@ -874,7 +873,6 @@ case $(uname -s) in
 *CYGWIN*)
 	test_set_prereq POSIXPERM
 	test_set_prereq EXECKEEPSPID
-	test_set_prereq NOT_MINGW
 	test_set_prereq CYGWIN
 	test_set_prereq SED_STRIPS_CR
 	test_set_prereq GREP_STRIPS_CR
@@ -883,8 +881,6 @@ case $(uname -s) in
 	test_set_prereq POSIXPERM
 	test_set_prereq BSLASHPSPEC
 	test_set_prereq EXECKEEPSPID
-	test_set_prereq NOT_MINGW
-	test_set_prereq NOT_CYGWIN
 	;;
 esac
 
-- 
2.0.2-870-g9e2e527

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 2/2] test prerequisites: enumerate with commas
  2014-07-21 20:07                     ` Junio C Hamano
  2014-07-21 22:29                       ` Junio C Hamano
@ 2014-07-21 22:30                       ` Junio C Hamano
  1 sibling, 0 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-21 22:30 UTC (permalink / raw)
  To: kusmabite
  Cc: Stepan Kasal, Karsten Blees, Johannes Sixt, GIT Mailing-list,
	msysGit, Pat Thoyts

test_have_prereq does understand multiple predicates given as
separate arguments, but that is by accident.  We should list the
prerequisites just like we use them as the (first) optional
parameter for test_expect_success, concatenated with commas, for
consistency.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t9809-git-p4-client-view.sh |  4 ++--
 t/t9812-git-p4-wildcards.sh   | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/t/t9809-git-p4-client-view.sh b/t/t9809-git-p4-client-view.sh
index e80db7a..897b3c3 100755
--- a/t/t9809-git-p4-client-view.sh
+++ b/t/t9809-git-p4-client-view.sh
@@ -365,7 +365,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
 	(
 		cd "$git" &&
 		echo git-wild-hash >dir1/git-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			echo git-wild-star >dir1/git-wild\*star
 		fi &&
@@ -379,7 +379,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
 	(
 		cd "$cli" &&
 		test_path_is_file dir1/git-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			test_path_is_file dir1/git-wild\*star
 		fi &&
diff --git a/t/t9812-git-p4-wildcards.sh b/t/t9812-git-p4-wildcards.sh
index ed4b488..0206771 100755
--- a/t/t9812-git-p4-wildcards.sh
+++ b/t/t9812-git-p4-wildcards.sh
@@ -14,7 +14,7 @@ test_expect_success 'add p4 files with wildcards in the names' '
 		printf "file2\nhas\nsome\nrandom\ntext\n" >file2 &&
 		p4 add file2 &&
 		echo file-wild-hash >file-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			echo file-wild-star >file-wild\*star
 		fi &&
@@ -31,7 +31,7 @@ test_expect_success 'wildcard files git p4 clone' '
 	(
 		cd "$git" &&
 		test -f file-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			test -f file-wild\*star
 		fi &&
@@ -46,7 +46,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
 	(
 		cd "$git" &&
 		echo git-wild-hash >git-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			echo git-wild-star >git-wild\*star
 		fi &&
@@ -60,7 +60,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
 	(
 		cd "$cli" &&
 		test_path_is_file git-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			test_path_is_file git-wild\*star
 		fi &&
@@ -75,7 +75,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
 	(
 		cd "$git" &&
 		echo new-line >>git-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			echo new-line >>git-wild\*star
 		fi &&
@@ -89,7 +89,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
 	(
 		cd "$cli" &&
 		test_line_count = 2 git-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			test_line_count = 2 git-wild\*star
 		fi &&
@@ -152,7 +152,7 @@ test_expect_success 'wildcard files submit back to p4, delete' '
 	(
 		cd "$cli" &&
 		test_path_is_missing git-wild#hash &&
-		if test_have_prereq !MINGW !CYGWIN
+		if test_have_prereq !MINGW,!CYGWIN
 		then
 			test_path_is_missing git-wild\*star
 		fi &&
-- 
2.0.2-870-g9e2e527

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
  2014-07-21 22:29                       ` Junio C Hamano
@ 2014-07-21 22:39                         ` Junio C Hamano
  0 siblings, 0 replies; 46+ messages in thread
From: Junio C Hamano @ 2014-07-21 22:39 UTC (permalink / raw)
  To: kusmabite
  Cc: Stepan Kasal, Karsten Blees, Johannes Sixt, GIT Mailing-list,
	msysGit, Pat Thoyts

Junio C Hamano <gitster@pobox.com> writes:

> So here is the first of the two small/trivial patch series. 
>
> To prepare the first one, I did "git grep -e '\<NOT_' t/" to the
> result of applying Stepan's series and edited the hits manually.
> And then compared the result with running
>
>  $ perl -p -i -e 'if (!/\btest_set_prereq\s/) {
>        s/\bNOT_([A-Z]*)\b/!$1/g
>    }' t/t*.sh
>
> on Stepan's series to see if I missed anything.
>
> The second one was discovered while doing the manual fix mentioned
> above.
> ...
>  t/t1402-check-ref-format.sh   | 32 ++++++++++++++++----------------
>  t/test-lib.sh                 |  4 ----
>  15 files changed, 52 insertions(+), 56 deletions(-)

Unfortunately, t1402 needs more work X-<.

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2014-07-21 22:39 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-10 20:05 Topic sk/mingw-unicode-spawn-args breaks tests Johannes Sixt
2014-07-11 19:49 ` Karsten Blees
2014-07-12  7:50   ` Stepan Kasal
2014-07-15  0:21     ` Johannes Schindelin
2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
2014-07-15 13:43       ` [PATCH 1/3] Win32: Unicode file name support (except dirent) Stepan Kasal
2014-07-15 13:43       ` [PATCH 2/3] Win32: Unicode file name support (dirent) Stepan Kasal
2014-07-15 13:43       ` [PATCH 3/3] tests: do not pass iso8859-1 encoded parameter Stepan Kasal
2014-07-15 13:53       ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
2014-07-15 18:20       ` Junio C Hamano
2014-07-15 22:52         ` Karsten Blees
2014-07-15 22:53           ` [PATCH 1/2] MinGW: fix compile error due to missing ELOOP Karsten Blees
2014-07-15 23:42             ` Jonathan Nieder
2014-07-15 23:57               ` Karsten Blees
2014-07-16 17:43             ` Junio C Hamano
2014-07-15 22:54           ` [PATCH 2/2] config: use chmod() instead of fchmod() Karsten Blees
2014-07-16  5:33             ` Johannes Sixt
2014-07-16 10:53               ` Karsten Blees
2014-07-16 22:16             ` Junio C Hamano
2014-07-17  8:57               ` Karsten Blees
2014-07-16  9:29           ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
2014-07-16 11:01             ` Thomas Braun
2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
2014-07-17 15:37               ` [PATCH 1/6] MinGW: Skip test redirecting to fd 4 Stepan Kasal
2014-07-17 18:41                 ` Junio C Hamano
2014-07-17 20:06                   ` Johannes Schindelin
2014-07-17 20:18                   ` Karsten Blees
2014-07-17 20:38                     ` Junio C Hamano
2014-07-17 15:37               ` [PATCH 2/6] Disable t0110's high-bit test on Windows Stepan Kasal
2014-07-17 18:20                 ` Karsten Blees
2014-07-18 18:26                   ` Junio C Hamano
2014-07-19 19:37                     ` [PATCH] t0110/MinGW: skip tests that pass arbitrary bytes on the command line Karsten Blees
2014-07-21 16:41                       ` Junio C Hamano
2014-07-17 15:37               ` [PATCH 3/6] MinGW: disable legacy encoding tests Stepan Kasal
2014-07-17 15:37               ` [PATCH 4/6] t4210: skip command-line encoding tests on mingw Stepan Kasal
2014-07-18  9:52                 ` Erik Faye-Lund
2014-07-21 16:59                   ` Junio C Hamano
2014-07-21 17:45                     ` Johannes Schindelin
2014-07-21 19:21                       ` Johannes Sixt
2014-07-21 20:07                     ` Junio C Hamano
2014-07-21 22:29                       ` Junio C Hamano
2014-07-21 22:39                         ` Junio C Hamano
2014-07-21 22:30                       ` [PATCH 2/2] test prerequisites: enumerate with commas Junio C Hamano
2014-07-17 15:37               ` [PATCH 5/6] t9902: mingw-specific fix for gitfile link files Stepan Kasal
2014-07-17 20:42                 ` Junio C Hamano
2014-07-17 15:37               ` [PATCH 6/6] t800[12]: work around MSys limitation Stepan Kasal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.