Topic sk/mingw-unicode-spawn-args breaks tests
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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Am 10.07.2014 22:05, schrieb Johannes Sixt:
Quoted 14 lines
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)
Quoted 5 lines
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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Hello Hannes,
Quoted 2 lines
Am 10.07.2014 22:05, schrieb Johannes Sixt:
Quoted 1 line
It looks like I totally missed the topic sk/mingw-unicode-spawn-args.
...
Quoted 2 lines
Quoted 2 lines
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.
Quoted 2 lines · Karsten
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.
Quoted 4 lines
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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
cover fix test suite with mingw-unicode patches
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(-)
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 1/3 Win32: Unicode file name support (except dirent)
From: Karsten Blees <[email protected]>
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.
--- compat/mingw.c | 198 ++++++++++++++++++++++++++++++++++++++++++--------------- compat/mingw.h | 18 ++++-- 2 files changed, 160 insertions(+), 56 deletions(-)
compat/mingw.c +146 -52
@@ -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 unlinkint 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 rmdirint 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 openint 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 fopenFILE *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 freopenFILE *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 getcwdchar *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 ; }
compat/mingw.h +14 -4
@@ -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
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 2/3 Win32: Unicode file name support (dirent)
In reply to Stepan KasalFrom: Karsten Blees <[email protected]>
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).
--- compat/win32/dirent.c | 30 ++++++++++-------------------- compat/win32/dirent.h | 2 +- 2 files changed, 11 insertions(+), 21 deletions(-)
compat/win32/dirent.c +10 -20
@@ -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 ();
compat/win32/dirent.h +1 -1
@@ -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);
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 3/3 tests: do not pass iso8859-1 encoded parameter
In reply to Stepan KasalFrom: Pat Thoyts <[email protected]>
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 <[email protected]>
Author: Stepan Kasal <[email protected]>
--- 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(-)
t/t4041-diff-submodule-option.sh +4 -2
@@ -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 )
t/t4205-log-pretty-formats.sh +1 -1
@@ -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" &&
t/t6006-rev-list-format.sh +2 -2
@@ -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:) &&
t/t7102-reset.sh +6 -2
@@ -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 '
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 0/3] fix test suite with mingw-unicode patches
In reply to Stepan KasalHello,
I'm sorry that I have to reply to my own mail, but I forgot this:
Quoted 2 lines
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
Quoted 1 line
Win32: Unicode file name support (dirent)
Both of theese patches are in msysgit for more than 2 years.
Quoted 2 lines
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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 0/3] fix test suite with mingw-unicode patches
In reply to Stepan KasalQuoted 17 lines · 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
Quoted 6 lines
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.
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 0/3] fix test suite with mingw-unicode patches
Am 15.07.2014 20:20, schrieb Junio C Hamano:
Quoted 23 lines
Quoted 21 lines · 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,
StepanKarsten Blees (2):
Win32: Unicode file name support (except dirent)
Win32: Unicode file name support (dirent)
Quoted 7 lines
Quoted 2 lines
Pat Thoyts and Stepan Kasal(1):
tests: do not pass iso8859-1 encoded parameterThanks. 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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 0/3] fix test suite with mingw-unicode patches
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:
Quoted 5 lines
* t0110-urlmatch-normalization: 1
Passing binary data on the command line...would have to teach
test-urlmatch-normalization.cto 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.
Quoted 4 lines
* 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.
Quoted 2 lines
* 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.
Quoted 4 lines
* 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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 0/3] fix test suite with mingw-unicode patches
Am 16.07.2014 11:29, schrieb Stepan Kasal:
Quoted 8 lines
Quoted 2 lines
* 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/6d3e23d4But 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.
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
cover mingw test fixes
In reply to Stepan KasalHello,
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(-)
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 1/6 MinGW: Skip test redirecting to fd 4
From: Johannes Schindelin <[email protected]>
... because that does not work in MinGW.
--- t/t0081-line-buffer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t0081-line-buffer.sh +1 -1
@@ -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 &&
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4
Quoted 15 lines · Stepan Kasal
From: Johannes Schindelin <[email protected]>
... because that does not work in MinGW.
Signed-off-by Johannes Schindelin <[email protected]>Signed-off-by Stepan Kasal <[email protected]>--- t/t0081-line-buffer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)t/t0081-line-buffer.sh +0
-0
t/t0081-line-buffer.sh test_expect_success '0-length read, send along greeting' ' · line 35
Quoted 8 lines
t/t0081-line-buffer.sh +1
-1@@ -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(-)
t/t0081-line-buffer.sh +1 -2
@@ -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 '
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4
Am 17.07.2014 20:41, schrieb Junio C Hamano:
Quoted 30 lines
Quoted 15 lines · Stepan Kasal
From: Johannes Schindelin <[email protected]>
... because that does not work in MinGW.
Signed-off-by Johannes Schindelin <[email protected]>Signed-off-by Stepan Kasal <[email protected]>--- t/t0081-line-buffer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)t/t0081-line-buffer.sh +0
-0t/t0081-line-buffer.sh test_expect_success '0-length read, send along greeting' ' · line 35
Quoted 8 lines
t/t0081-line-buffer.sh +1
-1@@ -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 ofbuffer_init(), and the file descriptor does not have to be "4" for the purpose of the test, no?
Quoted 1 line
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.
t/t0081-line-buffer.sh test_expect_success 'read from file descriptor' ' · line 36
Quoted 3 lines
t/t0081-line-buffer.sh +1
-2- 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.
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4
Quoted 10 lines · Karsten Blees
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.
t/t0081-line-buffer.sh test_expect_success 'read from file descriptor' ' · line 36
Quoted 3 lines
t/t0081-line-buffer.sh +1
-2- 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.
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4
In reply to Junio C HamanoHi Junio,
Quoted 1 line · Junio C Hamano
Is what is broken on MinGW redirecting arbitrary file descrptors?
IIRC that was exactly the problem.
t/t0081-line-buffer.sh test_expect_success 'read from file descriptor' ' · line 38
Quoted 12 lines
t/t0081-line-buffer.sh +1
-2@@ -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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 2/6 Disable t0110's high-bit test on Windows
In reply to Stepan KasalFrom: Johannes Schindelin <[email protected]>
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".
--- t/t0110-urlmatch-normalization.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t0110-urlmatch-normalization.sh +1 -1
@@ -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" &&
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 2/6] Disable t0110's high-bit test on Windows
Am 17.07.2014 17:37, schrieb Stepan Kasal:
Quoted 7 lines
From: Johannes Schindelin <[email protected]>
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"
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 2/6] Disable t0110's high-bit test on Windows
Quoted 9 lines · Karsten Blees
Am 17.07.2014 17:37, schrieb Stepan Kasal:
Quoted 7 lines
From: Johannes Schindelin <[email protected]>
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.
Quoted 10 lines
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
0x80without 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.
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 1/1 t0110/MinGW: skip tests that pass arbitrary bytes on the command line
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.
--- t/t0110-urlmatch-normalization.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
t/t0110-urlmatch-normalization.sh +5 -2
@@ -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" '
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH] t0110/MinGW: skip tests that pass arbitrary bytes on the command line
Quoted 5 lines · Karsten Blees
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 <[email protected]>---
Thanks; will replace.
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 3/6 MinGW: disable legacy encoding tests
In reply to Stepan KasalFrom: Karsten Blees <[email protected]>
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.
--- t/t3901-i18n-patch.sh | 19 +++++++++++-------- t/t4201-shortlog.sh | 6 +++--- t/t8005-blame-i18n.sh | 8 ++++---- 3 files changed, 18 insertions(+), 15 deletions(-)
t/t3901-i18n-patch.sh +11 -8
@@ -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.
t/t4201-shortlog.sh +3 -3
@@ -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 &&
t/t8005-blame-i18n.sh +4 -4
@@ -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 &&
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 4/6 t4210: skip command-line encoding tests on mingw
In reply to Stepan KasalFrom: Pat Thoyts <[email protected]>
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.
--- t/t4210-log-i18n.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
t/t4210-log-i18n.sh +2 -2
@@ -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
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
Quoted 27 lines · Stepan Kasal
From: Pat Thoyts <[email protected]>
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 <[email protected]>Signed-off-by Stepan Kasal <[email protected]>--- t/t4210-log-i18n.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)t/t4210-log-i18n.sh +1
-1@@ -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
t/t4210-log-i18n.sh test_expect_success 'log --grep searches in log output encoding (latin1)' ' · line 46
Quoted 5 lines
t/t4210-log-i18n.sh +1
-1@@ -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?
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
Quoted 17 lines · Erik Faye-Lund
Quoted 16 lines · Stepan Kasal
From: Pat Thoyts <[email protected]>
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.
...t/t4210-log-i18n.sh +1
-1-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 '
Quoted 6 lines
t/t4210-log-i18n.sh test_expect_success 'log --grep searches in log output encoding (latin1)' ' · line 46
Quoted 2 lines
t/t4210-log-i18n.sh +1
-1-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?
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
Hi Junio,
Quoted 2 lines · Junio C Hamano
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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
Am 21.07.2014 19:45, schrieb Johannes Schindelin:
Quoted 9 lines
Hi Junio,
Quoted 2 lines · Junio C Hamano
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_MINGWI 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.
Quoted 1 line
Let's use the latter consistently?
Of course!
-- Hannes
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
In reply to Junio C HamanoQuoted 2 lines · Junio C Hamano
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.
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
Quoted 5 lines · Junio C Hamano
Quoted 2 lines · Junio C Hamano
Oh by the way, can somebody remind me why we spell these as
NOT_MINGW, instead of !MINGW?
Quoted 7 lines
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 useNOT_MINGW(and a few MINGW) as prerequisites. We can safely replace uses ofNOT_MINGWprerequisite 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*.shon 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.
--- 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(-)
t/t0008-ignores.sh +1 -1
@@ -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 " &&
t/t0081-line-buffer.sh +1 -1
@@ -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 &&
t/t1020-subdirectory.sh +1 -1
@@ -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 &&
t/t1300-repo-config.sh +3 -3
@@ -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 \
t/t1402-check-ref-format.sh +16 -16
@@ -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'
t/t3901-i18n-patch.sh +5 -5
@@ -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.
t/t4201-shortlog.sh +3 -3
@@ -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 &&
t/t4210-log-i18n.sh +2 -2
@@ -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
t/t5601-clone.sh +2 -2
@@ -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 '
t/t8005-blame-i18n.sh +4 -4
@@ -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 &&
t/t9300-fast-import.sh +4 -4
@@ -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
t/t9809-git-p4-client-view.sh +2 -2
@@ -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 &&
t/t9812-git-p4-wildcards.sh +7 -7
@@ -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 &&
t/t9815-git-p4-submit-fail.sh +1 -1
@@ -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
t/test-lib.sh +0 -4
@@ -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
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 4/6] t4210: skip command-line encoding tests on mingw
Quoted 10 lines · Junio C Hamano
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
Quoted 8 lines
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-<.
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 2/2 test prerequisites: enumerate with commas
In reply to Junio C Hamanotest_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.
--- t/t9809-git-p4-client-view.sh | 4 ++-- t/t9812-git-p4-wildcards.sh | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-)
t/t9809-git-p4-client-view.sh +2 -2
@@ -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 &&
t/t9812-git-p4-wildcards.sh +7 -7
@@ -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 &&
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 5/6 t9902: mingw-specific fix for gitfile link files
In reply to Stepan KasalFrom: Pat Thoyts <[email protected]>
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 /.
--- t/t9902-completion.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
t/t9902-completion.sh +13 -4
@@ -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 &&
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 5/6] t9902: mingw-specific fix for gitfile link files
Quoted 5 lines · Stepan Kasal
From: Pat Thoyts <[email protected]>
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?
Quoted 47 lines
Signed-off-by Pat Thoyts <[email protected]>Signed-off-by Stepan Kasal <[email protected]>--- t/t9902-completion.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)t/t9902-completion.sh +13
-4@@ -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 &&Signature · 3 lines
2.0.0.9635.g0be03cb --
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 6/6 t800[12]: work around MSys limitation
In reply to Stepan KasalFrom: Karsten Blees <[email protected]>
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.
Author: Stepan Kasal <[email protected]>
--- t/annotate-tests.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+)
t/annotate-tests.sh +12 -0
@@ -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
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 1/2 MinGW: fix compile error due to missing ELOOP
In reply to Karsten BleesMinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many links") instead.
--- compat/mingw.h | 3 +++ 1 file changed, 3 insertions(+)
compat/mingw.h +3 -0
@@ -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
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 1/2] MinGW: fix compile error due to missing ELOOP
Quoted 2 lines · Karsten Blees
MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many links") instead.
[...]
compat/mingw.h typedef int socklen_t; · line 40
Quoted 3 lines
compat/mingw.h +3
-0+#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).
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 1/2] MinGW: fix compile error due to missing ELOOP
Am 16.07.2014 01:42, schrieb Jonathan Nieder:
Quoted 11 lines
Quoted 2 lines · Karsten Blees
MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many links") instead.
[...]
compat/mingw.h typedef int socklen_t; · line 40
Quoted 3 lines
compat/mingw.h +3
-0+#ifndef ELOOP +#define ELOOP EMLINK +#endif This could use
Quoted 7 lines
#define ELOOP WSAELOOPas 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 <[email protected]>
It matters when we report the error to the user (i.e. via die_errno):
strerror(EMLINK) -> "Too many links"
strerror(10062) -> "Unknown error"
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 1/2] MinGW: fix compile error due to missing ELOOP
In reply to Karsten BleesQuoted 5 lines · Karsten Blees
MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka "Too many links") instead.
Signed-off-by Karsten Blees <[email protected]>---
Thanks; will apply directly to 'master'.
Quoted 21 lines
compat/mingw.h | 3 +++ 1 file changed, 3 insertions(+)compat/mingw.h +3
-0@@ -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 1Signature · 3 lines
2.0.1.779.g26aeac4.dirty --
PATCH 2/2 config: use chmod() instead of fchmod()
In reply to Karsten BleesThere is no fchmod() on native Windows platforms (MinGW and MSVC), and the equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.
Use chmod() instead.
--- config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
config.c +4 -4
@@ -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; }
Signature · 21 lines
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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 2/2] config: use chmod() instead of fchmod()
Am 16.07.2014 00:54, schrieb Karsten Blees:
Quoted 27 lines
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 <[email protected]>--- config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)config.c +2
-2@@ -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;
config.c int git_config_rename_section_in_file(const char *config_filename, · line 1822
Quoted 10 lines
config.c +2
-2@@ -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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 2/2] config: use chmod() instead of fchmod()
Am 16.07.2014 07:33, schrieb Johannes Sixt:
Quoted 42 lines
Am 16.07.2014 00:54, schrieb Karsten Blees:
Quoted 27 lines
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 <[email protected]>--- config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)config.c +2
-2@@ -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;config.c int git_config_rename_section_in_file(const char *config_filename, · line 1822
Quoted 10 lines
config.c +2
-2@@ -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.
Quoted 2 lines
-- 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).
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 2/2] config: use chmod() instead of fchmod()
In reply to Karsten BleesQuoted 7 lines · 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 <[email protected]>---
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.
Quoted 33 lines
config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)config.c +4
-4@@ -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; }Signature · 3 lines
2.0.1.779.g26aeac4.dirty --
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 2/2] config: use chmod() instead of fchmod()
Am 17.07.2014 00:16, schrieb Junio C Hamano:
Quoted 7 lines
Quoted 5 lines · 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.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Karsten Blees <[email protected]>---
I am wondering if it is saner to just revert the
fchmod()patch and replace it with something along the lines ofhttp://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)'?
Quoted 4 lines
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.
Hi Stepan,
Quoted 7 lines · Stepan Kasal
Quoted 2 lines
Am 10.07.2014 22:05, schrieb Johannes Sixt:
Quoted 1 line
It looks like I totally missed the topic sk/mingw-unicode-spawn-args.
...
Quoted 2 lines
Quoted 2 lines
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.
;-)
Quoted 2 lines
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
Signature · 18 lines
-- *** 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.