{"thread":{"id":"41563","subject":"50a6c8ef - xmalloc_array","startedAt":"2016-02-29T06:30:02Z","lastAt":"2016-05-10T18:29:30Z","messageCount":18,"participants":["Torsten Bögershausen","Jeff King","Ramsay Jones","Johannes Schindelin","SZEDER Gábor","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"279742","messageId":"56D3E56A.5010608@web.de","threadId":"41563","inReplyTo":null,"subject":"50a6c8ef - xmalloc_array","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-02-29T06:30:02Z","receivedAt":"2016-02-29T06:30:02Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"I haven't digged further,\nbut trying to verify t9115 under Windows gave this:\n\n\ncompat/mingw.c: In function 'mingw_spawnve_fd':\ncompat/mingw.c:1072:10: warning: implicit declaration of function \n'xmalloc_array' [-Wimplicit-function-declaration]\n   wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n           ^\ncompat/mingw.c:1072:8: warning: assignment makes pointer from integer without a \ncast [-Wint-conversion]\n   wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n         ^\n--- and later ---\n\nlibgit.a(mingw.o): In function `mingw_spawnve_fd':\n..... compat/mingw.c:1072: undefined reference to `xmalloc_array'\ncollect2.exe: error: ld returned 1 exit status\nMakefile:2014: recipe for target 'git-credential-store.exe' failed\nmake: *** [git-credential-store.exe] Error 1\n"},{"id":"279754","messageId":"20160229092816.GA23910@sigill.intra.peff.net","threadId":"41563","inReplyTo":"56D3E56A.5010608@web.de","subject":"[PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-29T09:28:16Z","receivedAt":"2016-02-29T09:28:16Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 29, 2016 at 07:30:02AM +0100, Torsten Bögershausen wrote:\n\n> I haven't digged further,\n> but trying to verify t9115 under Windows gave this:\n> \n> compat/mingw.c: In function 'mingw_spawnve_fd':\n> compat/mingw.c:1072:10: warning: implicit declaration of function\n> 'xmalloc_array' [-Wimplicit-function-declaration]\n>   wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n>           ^\n\nYikes.\n\n-- >8 --\nSubject: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e\n\nCommit 50a6c8e (use st_add and st_mult for allocation size\ncomputation, 2016-02-22) fixed up many xmalloc call-sites\nincluding ones in compat/mingw.c.\n\nBut I screwed up one of them, which was half-converted to\nALLOC_ARRAY, using a very early prototype of the function.\nAnd I never caught it because I don't build on Windows.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI think this means \"master\" is broken for mingw builds.\n\nSorry, Windows people, for breaking your build. I'm happy to hold back\nsuch repo-wide cleanups from the mingw code in the future, since I can't\nactually compile them. But the flipside is that if I _do_ improve\nthings, you don't get the benefit until somebody manually ports it over.\n\n compat/mingw.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex cfedcf9..54c82ec 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1069,7 +1069,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen\n \t\t\tfree(quoted);\n \t}\n \n-\twargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n+\tALLOC_ARRAY(wargs, st_add(st_mult(2, args.len), 1));\n \txutftowcs(wargs, args.buf, 2 * args.len + 1);\n \tstrbuf_release(&args);\n \n-- \n2.8.0.rc0.276.gddf4100\n"},{"id":"279757","messageId":"56D415C6.2040203@web.de","threadId":"41563","inReplyTo":"20160229092816.GA23910@sigill.intra.peff.net","subject":"Re: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-02-29T09:56:22Z","receivedAt":"2016-02-29T09:56:22Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Thanks for the fast-patch.\n\nI manually copied the patch, But there are more probles, it seems.\n\n$ git diff\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex cfedcf9..b1163f2 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1069,7 +1069,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char \n**argv, char **deltaen\n                         free(quoted);\n         }\n\n-       wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n+       wargs = ALLOC_ARRAY(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n         xutftowcs(wargs, args.buf, 2 * args.len + 1);\n         strbuf_release(&args);\n\n\ntb@torbogwm MINGW64 ~/Users/tb/projects/git/tb ((2273582...))\n$ make\n     CC compat/mingw.o\nIn file included from compat/mingw.c:1:0:\ncompat/mingw.c: In function 'mingw_spawnve_fd':\ncompat/../git-compat-util.h:769:60: error: invalid type argument of unary '*' \n(have 'size_t {aka long long unsigned int}')\n  #define ALLOC_ARRAY(x, alloc) (x) = xmalloc(st_mult(sizeof(*(x)), (alloc)))\n                                                             ^\ncompat/mingw.c:1072:10: note: in expansion of macro 'ALLOC_ARRAY'\n   wargs = ALLOC_ARRAY(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n           ^\nMakefile:1948: recipe for target 'compat/mingw.o' failed\nmake: *** [compat/mingw.o] Error 1\n"},{"id":"279759","messageId":"20160229100258.GC2950@sigill.intra.peff.net","threadId":"41563","inReplyTo":"56D415C6.2040203@web.de","subject":"Re: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-29T10:02:59Z","receivedAt":"2016-02-29T10:02:59Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 29, 2016 at 10:56:22AM +0100, Torsten Bögershausen wrote:\n\n> Thanks for the fast-patch.\n> \n> I manually copied the patch, But there are more probles, it seems.\n> \n> $ git diff\n> diff --git a/compat/mingw.c b/compat/mingw.c\n> index cfedcf9..b1163f2 100644\n> --- a/compat/mingw.c\n> +++ b/compat/mingw.c\n> @@ -1069,7 +1069,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const\n> char **argv, char **deltaen\n>                         free(quoted);\n>         }\n> \n> -       wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n> +       wargs = ALLOC_ARRAY(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n>         xutftowcs(wargs, args.buf, 2 * args.len + 1);\n>         strbuf_release(&args);\n\nArgh. Let me write \"git commit -a\" on the inside of my brown paper bag,\nso that I actually send out the fix sitting in my working tree, not the\nhalf-finished thing I ran \"git add\" on.\n\n-- >8 --\nSubject: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e\n\nCommit 50a6c8e (use st_add and st_mult for allocation size\ncomputation, 2016-02-22) fixed up many xmalloc call-sites\nincluding ones in compat/mingw.c.\n\nBut I screwed up one of them, which was half-converted to\nALLOC_ARRAY, using a very early prototype of the function.\nAnd I never caught it because I don't build on Windows.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n compat/mingw.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex cfedcf9..54c82ec 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1069,7 +1069,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen\n \t\t\tfree(quoted);\n \t}\n \n-\twargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n+\tALLOC_ARRAY(wargs, st_add(st_mult(2, args.len), 1));\n \txutftowcs(wargs, args.buf, 2 * args.len + 1);\n \tstrbuf_release(&args);\n \n-- \n2.8.0.rc0.276.gddf4100\n"},{"id":"279762","messageId":"56D4203B.1030708@web.de","threadId":"41563","inReplyTo":"20160229100258.GC2950@sigill.intra.peff.net","subject":"Compiler warning under cygwin/mingw (was: fix for 50a6c8e)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-02-29T10:40:59Z","receivedAt":"2016-02-29T10:40:59Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"That compiles OK, thanks.\n\n\nSorry for high-jacking this thread, but while compiling under CYGWIN,\nfound one warning:\n\n    LINK git-credential-store.exe\n     CC daemon.o\ndaemon.c: In function ‘drop_privileges’:\ndaemon.c:1136:15: warning: implicit declaration of function ‘initgroups’ \n[-Wimplicit-function-declaration]\n   if (cred && (initgroups(cred->pass->pw_name, cred->gid) ||\n                ^\n\nt9115 doesn't pass,  NTFS doesn't like the non-UTF filenames, it seams.\nProbably the same problem as under Mac OS /HFS+-\n-----------------------\n\nAnd MINGW is not happy for other reasons:\n\nbuiltin/rev-parse.c: In function 'cmd_rev_parse':\nbuiltin/rev-parse.c:775:12: warning: implicit declaration of function \n'realpath' [-Wimplicit-function-declaration]\n        if (!realpath(gitdir, absolute_path))\n             ^\n     CC builtin/revert.o\n\n\n     CC builtin/write-tree.o\n     LINK git.exe\nbuiltin/rev-parse.o: In function `cmd_rev_parse':\nC:\\Users\\tb\\projects\\git\\tb/builtin/rev-parse.c:775: undefined reference to \n`realpath'\ncollect2.exe: error: ld returned 1 exit status\nMakefile:1725: recipe for target 'git.exe' failed\nmake: *** [git.exe] Error 1\n"},{"id":"279763","messageId":"20160229104708.GA17042@sigill.intra.peff.net","threadId":"41563","inReplyTo":"56D4203B.1030708@web.de","subject":"Re: Compiler warning under cygwin/mingw (was: fix for 50a6c8e)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-29T10:47:08Z","receivedAt":"2016-02-29T10:47:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 29, 2016 at 11:40:59AM +0100, Torsten Bögershausen wrote:\n\n> That compiles OK, thanks.\n> \n> Sorry for high-jacking this thread, but while compiling under CYGWIN,\n> found one warning:\n> \n>    LINK git-credential-store.exe\n>     CC daemon.o\n> daemon.c: In function ‘drop_privileges’:\n> daemon.c:1136:15: warning: implicit declaration of function ‘initgroups’\n> [-Wimplicit-function-declaration]\n>   if (cred && (initgroups(cred->pass->pw_name, cred->gid) ||\n\nInteresting that it doesn't later complain in the link step. :)\n\nYou should probably be compiling with the NO_INITGROUPS knob on that\nplatform.\n\n> t9115 doesn't pass,  NTFS doesn't like the non-UTF filenames, it seams.\n> Probably the same problem as under Mac OS /HFS+-\n> -----------------------\n\nNo comment from me on that one.\n\n> And MINGW is not happy for other reasons:\n> \n> builtin/rev-parse.c: In function 'cmd_rev_parse':\n> builtin/rev-parse.c:775:12: warning: implicit declaration of function\n> 'realpath' [-Wimplicit-function-declaration]\n>        if (!realpath(gitdir, absolute_path))\n>             ^\n\nI guess you're building \"pu\"; that is only in sg/completion-updates. I\ndon't know if our custom real_path() would suffice there. You might want\nto ping the author. The patch is:\n\n  http://article.gmane.org/gmane.comp.version-control.git/287462\n\n-Peff\n"},{"id":"279772","messageId":"56D43A61.3090503@ramsayjones.plus.com","threadId":"41563","inReplyTo":"56D4203B.1030708@web.de","subject":"Re: Compiler warning under cygwin/mingw","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-02-29T12:32:33Z","receivedAt":"2016-02-29T12:32:33Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 29/02/16 10:40, Torsten Bögershausen wrote:\n> That compiles OK, thanks.\n> \n> \n> Sorry for high-jacking this thread, but while compiling under CYGWIN,\n> found one warning:\n> \n>    LINK git-credential-store.exe\n>     CC daemon.o\n> daemon.c: In function ‘drop_privileges’:\n> daemon.c:1136:15: warning: implicit declaration of function ‘initgroups’ [-Wimplicit-function-declaration]\n>   if (cred && (initgroups(cred->pass->pw_name, cred->gid) ||\n\nYeah, this has been there for a while - except it depends on which version\nof the header files you have. (Some may not see the warning).\n\nI have 'fixed' this twice before, then updated my installation and\na change to the system headers broke it again! (The headers are\ncurrently 'broken'). So, I got tired of fixing it up and have left\nit a while - you never know a new update may fix it! ;-)\n\n[I personally don't use the git daemon on cygwin, so I don't know\nif this a problem in practice.]\n\nATB,\nRamsay Jones\n"},{"id":"279775","messageId":"alpine.DEB.2.20.1602291359580.3152@virtualbox","threadId":"41563","inReplyTo":"20160229092816.GA23910@sigill.intra.peff.net","subject":"Re: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-02-29T13:01:52Z","receivedAt":"2016-02-29T13:01:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Peff,\n\nOn Mon, 29 Feb 2016, Jeff King wrote:\n\n> I think this means \"master\" is broken for mingw builds.\n> \n> Sorry, Windows people, for breaking your build. I'm happy to hold back\n> such repo-wide cleanups from the mingw code in the future, since I can't\n> actually compile them. But the flipside is that if I _do_ improve\n> things, you don't get the benefit until somebody manually ports it over.\n\nNo, I do not think that you need to hold back cleanups. We will catch such\nissues before long, anyway.\n\nThanks for all your hard work!\nDscho\n"},{"id":"279780","messageId":"1456754714-25237-1-git-send-email-szeder@ira.uka.de","threadId":"41563","inReplyTo":"20160229104708.GA17042@sigill.intra.peff.net","subject":"Re: Compiler warning under cygwin/mingw (was: fix for 50a6c8e)","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2016-02-29T14:05:14Z","receivedAt":"2016-02-29T14:05:14Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\n> > And MINGW is not happy for other reasons:\n> >\n> > builtin/rev-parse.c: In function 'cmd_rev_parse':\n> > builtin/rev-parse.c:775:12: warning: implicit declaration of function\n> > 'realpath' [-Wimplicit-function-declaration]\n> >        if (!realpath(gitdir, absolute_path))\n> >             ^\n> \n> I guess you're building \"pu\"; that is only in sg/completion-updates. I\n> don't know if our custom real_path() would suffice there. You might want\n> to ping the author. The patch is:\n> \n>   http://article.gmane.org/gmane.comp.version-control.git/287462\n\nOh, I was not aware that there is a custom real_path() that is\npreferred over the system realpath().  I don't see why our real_path()\nwould not suffice, it even makes the code a tad shorter.\n\nI will include the patch below in the reroll.\n\nBest,\nGábor\n\n\n ----  >8  ----\nSubject: [PATCH] fixup! rev-parse: add '--absolute-git-dir' option\n\n---\n builtin/rev-parse.c | 5 +----\n 1 file changed, 1 insertion(+), 4 deletions(-)\n\ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex 90a4dd6032c0..d6d9a82c77c4 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -762,10 +762,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)\n \t\t\t\t\tif (!gitdir && !prefix)\n \t\t\t\t\t\tgitdir = \".git\";\n \t\t\t\t\tif (gitdir) {\n-\t\t\t\t\t\tchar absolute_path[PATH_MAX];\n-\t\t\t\t\t\tif (!realpath(gitdir, absolute_path))\n-\t\t\t\t\t\t\tdie_errno(_(\"unable to get absolute path\"));\n-\t\t\t\t\t\tputs(absolute_path);\n+\t\t\t\t\t\tputs(real_path(gitdir));\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t}\n-- \n2.7.2.410.g92cb358\n"},{"id":"279813","messageId":"xmqqtwkr9vu6.fsf@gitster.mtv.corp.google.com","threadId":"41563","inReplyTo":"20160229100258.GC2950@sigill.intra.peff.net","subject":"Re: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-29T19:10:09Z","receivedAt":"2016-02-29T19:10:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Feb 29, 2016 at 10:56:22AM +0100, Torsten Bögershausen wrote:\n>\n>> Thanks for the fast-patch.\n>> \n>> I manually copied the patch, But there are more probles, it seems.\n>> \n>> $ git diff\n>> diff --git a/compat/mingw.c b/compat/mingw.c\n>> index cfedcf9..b1163f2 100644\n>> --- a/compat/mingw.c\n>> +++ b/compat/mingw.c\n>> @@ -1069,7 +1069,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const\n>> char **argv, char **deltaen\n>>                         free(quoted);\n>>         }\n>> \n>> -       wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n>> +       wargs = ALLOC_ARRAY(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n>>         xutftowcs(wargs, args.buf, 2 * args.len + 1);\n>>         strbuf_release(&args);\n>\n> Argh. Let me write \"git commit -a\" on the inside of my brown paper bag,\n> so that I actually send out the fix sitting in my working tree, not the\n> half-finished thing I ran \"git add\" on.\n\nJust to make sure that I am not confused, what you wrote below\nmatches what I received from you two message upthread.\n\nI am assuming that it is intended that the two messages from you\nhave the same patch, and the assignment of ALLOC_ARRAY to wargs was\na bug Torsten introduced only to his tree when cutting and pasting.\n\nWith that assumption, will queue this one (or the original one,\nwhich to me is the same thing).\n\nThanks.\n\n> -- >8 --\n> Subject: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e\n>\n> Commit 50a6c8e (use st_add and st_mult for allocation size\n> computation, 2016-02-22) fixed up many xmalloc call-sites\n> including ones in compat/mingw.c.\n>\n> But I screwed up one of them, which was half-converted to\n> ALLOC_ARRAY, using a very early prototype of the function.\n> And I never caught it because I don't build on Windows.\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  compat/mingw.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/compat/mingw.c b/compat/mingw.c\n> index cfedcf9..54c82ec 100644\n> --- a/compat/mingw.c\n> +++ b/compat/mingw.c\n> @@ -1069,7 +1069,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen\n>  \t\t\tfree(quoted);\n>  \t}\n>  \n> -\twargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n> +\tALLOC_ARRAY(wargs, st_add(st_mult(2, args.len), 1));\n>  \txutftowcs(wargs, args.buf, 2 * args.len + 1);\n>  \tstrbuf_release(&args);\n"},{"id":"279850","messageId":"20160229213620.GD25342@sigill.intra.peff.net","threadId":"41563","inReplyTo":"xmqqtwkr9vu6.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-29T21:36:20Z","receivedAt":"2016-02-29T21:36:20Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 29, 2016 at 11:10:09AM -0800, Junio C Hamano wrote:\n\n> >> -       wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n> >> +       wargs = ALLOC_ARRAY(st_add(st_mult(2, args.len), 1), sizeof(wchar_t));\n> >>         xutftowcs(wargs, args.buf, 2 * args.len + 1);\n> >>         strbuf_release(&args);\n> >\n> > Argh. Let me write \"git commit -a\" on the inside of my brown paper bag,\n> > so that I actually send out the fix sitting in my working tree, not the\n> > half-finished thing I ran \"git add\" on.\n> \n> Just to make sure that I am not confused, what you wrote below\n> matches what I received from you two message upthread.\n> \n> I am assuming that it is intended that the two messages from you\n> have the same patch, and the assignment of ALLOC_ARRAY to wargs was\n> a bug Torsten introduced only to his tree when cutting and pasting.\n> \n> With that assumption, will queue this one (or the original one,\n> which to me is the same thing).\n\nOh, <phew>. I am only half as incompetent as I thought, then.\n\nI didn't even re-check what I sent, and just assumed Torsten was quoting\nit exactly (I _did_ write something like that while making the fix, and\nassumed I had just failed to properly commit).\n\nSo yes, what I sent both times is the right thing. ;)\n\n-Peff\n"},{"id":"279938","messageId":"56D52D77.1030406@web.de","threadId":"41563","inReplyTo":"20160229213620.GD25342@sigill.intra.peff.net","subject":"Re: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-01T05:49:43Z","receivedAt":"2016-03-01T05:49:43Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\nOh, <phew>. I am only half as incompetent as I thought, then.\n\nI didn't even re-check what I sent, and just assumed Torsten was quoting\nit exactly (I _did_ write something like that while making the fix, and\nassumed I had just failed to properly commit).\n\nSo yes, what I sent both times is the right thing. ;)\n\n-Peff\n--\n\nI have no clue how my copy-paste programing could go so bad :-(\nSorry for the confusion, compat/mingw.c compiles now.\n\n----------------\n\nHowever, suspecting jk/epipe-in-async, I don't know if we can do\nsomething against this warning:\n\n  CC run-command.o\nrun-command.c: In function 'async_exit':\nrun-command.c:631:1: warning: 'noreturn' function does return\n  }\n  ^\n"},{"id":"279939","messageId":"20160301055457.GA1359@sigill.intra.peff.net","threadId":"41563","inReplyTo":"56D52D77.1030406@web.de","subject":"Re: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-03-01T05:54:57Z","receivedAt":"2016-03-01T05:54:57Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 01, 2016 at 06:49:43AM +0100, Torsten Bögershausen wrote:\n\n> However, suspecting jk/epipe-in-async, I don't know if we can do\n> something against this warning:\n> \n>  CC run-command.o\n> run-command.c: In function 'async_exit':\n> run-command.c:631:1: warning: 'noreturn' function does return\n>  }\n>  ^\n\nThe only thing that function does is call pthread_exit(), which should\nalso be marked NORETURN. Looks like the one in compat/win32/pthread.h\nisn't?\n\n-Peff\n"},{"id":"279952","messageId":"alpine.DEB.2.20.1603011452090.3152@virtualbox","threadId":"41563","inReplyTo":"20160301055457.GA1359@sigill.intra.peff.net","subject":"Re: [PATCH] compat/mingw: brown paper bag fix for 50a6c8e","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-01T13:52:36Z","receivedAt":"2016-03-01T13:52:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Peff,\n\nOn Tue, 1 Mar 2016, Jeff King wrote:\n\n> On Tue, Mar 01, 2016 at 06:49:43AM +0100, Torsten Bögershausen wrote:\n> \n> > However, suspecting jk/epipe-in-async, I don't know if we can do\n> > something against this warning:\n> > \n> >  CC run-command.o run-command.c: In function 'async_exit':\n> >  run-command.c:631:1: warning: 'noreturn' function does return } ^\n> \n> The only thing that function does is call pthread_exit(), which should\n> also be marked NORETURN. Looks like the one in compat/win32/pthread.h\n> isn't?\n\nCorrect. Expect a patch momentarily.\n\nCiao,\nDscho"},{"id":"280102","messageId":"56D7B07F.4010001@ramsayjones.plus.com","threadId":"41563","inReplyTo":"56D43A61.3090503@ramsayjones.plus.com","subject":"Re: Compiler warning under cygwin/mingw","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-03-03T03:33:19Z","receivedAt":"2016-03-03T03:33:19Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 29/02/16 12:32, Ramsay Jones wrote:\n> \n> \n> On 29/02/16 10:40, Torsten Bögershausen wrote:\n>> That compiles OK, thanks.\n>>\n>>\n>> Sorry for high-jacking this thread, but while compiling under CYGWIN,\n>> found one warning:\n>>\n>>    LINK git-credential-store.exe\n>>     CC daemon.o\n>> daemon.c: In function ‘drop_privileges’:\n>> daemon.c:1136:15: warning: implicit declaration of function ‘initgroups’ [-Wimplicit-function-declaration]\n>>   if (cred && (initgroups(cred->pass->pw_name, cred->gid) ||\n> \n> Yeah, this has been there for a while - except it depends on which version\n> of the header files you have. (Some may not see the warning).\n> \n> I have 'fixed' this twice before, then updated my installation and\n> a change to the system headers broke it again! (The headers are\n> currently 'broken'). So, I got tired of fixing it up and have left\n> it a while - you never know a new update may fix it! ;-)\n> \n> [I personally don't use the git daemon on cygwin, so I don't know\n> if this a problem in practice.]\n\nBTW, I forgot to mention that I have had a patch in my local repo for\nages which addresses this issue. However, although this patch fixes\nthe problem for me, with the header files I currently have installed, it\nwould just as easily _introduce_ this warning for those that don't\ncurrently see it! ;-)\n\nI suppose that I could send a patch which sets NO_INITGROUPS in the\nMakefile, until the system header files are fixed. What do you think?\n\nThe correct solution is to fix the <grp.h> header file. I have been\na bit reluctant to tackle that, because I'm not familiar with the\ncygwin project development process. Since Newlib is an upstream\nproject to cygwin, should I go there first/instead?\n\nAnyway, I had a quick squint at the header and I think it needs to\nbe changed something like the diff below. (I've also attached the\nnew grp.h file).\n\n[Note: I didn't know what to do about _PATH_GROUP, setgrfile(),\ngroup_from_gid() and setgroupent(), so I punted on those!]\n\nNow, If only we knew someone who could try introducing such a fix\nto the cygwin project ...\n\nATB,\nRamsay Jones\n-- >8 --\ndiff --git a/usr/include/grp.h b/grp.h\nindex c3a5a67..f2f1902 100644\n--- a/usr/include/grp.h\n+++ b/grp.h\n@@ -67,25 +67,27 @@ extern \"C\" {\n #ifndef __INSIDE_CYGWIN__\n struct group\t*getgrgid (gid_t);\n struct group\t*getgrnam (const char *);\n+#if defined __POSIX_VISIBLE || defined __BSD_VISIBLE\n int\t\t getgrnam_r (const char *, struct group *,\n \t\t\tchar *, size_t, struct group **);\n int\t\t getgrgid_r (gid_t, struct group *,\n \t\t\tchar *, size_t, struct group **);\n-#ifndef _POSIX_SOURCE\n-struct group\t*getgrent (void);\n+#endif\n+#if defined __BSD_VISIBLE || defined _XOPEN_SOURCE_EXTENDED\n void\t\t setgrent (void);\n+#if __XSI_VISIBLE >= 700\n+struct group\t*getgrent (void);\n void\t\t endgrent (void);\n+#endif\n+#endif\n+#if defined __BSD_VISIBLE\n+int\t\t initgroups (const char *, gid_t);\n+#endif\n #ifndef __CYGWIN__\n-void\t\t setgrfile (const char *);\n-#endif /* !__CYGWIN__ */\n-#ifndef _XOPEN_SOURCE\n-#ifndef __CYGWIN__\n+void\t\t setgrfile (const char *); /* 4.3BSD-Reno & Minix */\n char\t\t*group_from_gid (gid_t, int);\n-int\t\t setgroupent (int);\n+int\t\t setgroupent (int); /* 4.3BSD-Reno & Mac OS X */\n #endif /* !__CYGWIN__ */\n-int\t\t initgroups (const char *, gid_t);\n-#endif /* !_XOPEN_SOURCE */\n-#endif /* !_POSIX_SOURCE */\n #endif /* !__INSIDE_CYGWIN__ */\n \n #ifdef __cplusplus\n\n\n/*\t$NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $\t*/\n\n/*-\n * Copyright (c) 1989, 1993\n *\tThe Regents of the University of California.  All rights reserved.\n * (c) UNIX System Laboratories, Inc.\n * All or some portions of this file are derived from material licensed\n * to the University of California by American Telephone and Telegraph\n * Co. or Unix System Laboratories, Inc. and are reproduced herein with\n * the permission of UNIX System Laboratories, Inc.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *\tThis product includes software developed by the University of\n *\tCalifornia, Berkeley and its contributors.\n * 4. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n *\t@(#)grp.h\t8.2 (Berkeley) 1/21/94\n */\n\n#ifndef _GRP_H_\n#define\t_GRP_H_\n\n#include <sys/cdefs.h>\n#include <sys/types.h>\n#ifdef __CYGWIN__\n#include <cygwin/grp.h>\n#endif\n\n#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)\n#define\t_PATH_GROUP\t\t\"/etc/group\"\n#endif\n\nstruct group {\n\tchar\t*gr_name;\t\t/* group name */\n\tchar\t*gr_passwd;\t\t/* group password */\n\tgid_t\tgr_gid;\t\t\t/* group id */\n\tchar\t**gr_mem;\t\t/* group members */\n};\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef __INSIDE_CYGWIN__\nstruct group\t*getgrgid (gid_t);\nstruct group\t*getgrnam (const char *);\n#if defined __POSIX_VISIBLE || defined __BSD_VISIBLE\nint\t\t getgrnam_r (const char *, struct group *,\n\t\t\tchar *, size_t, struct group **);\nint\t\t getgrgid_r (gid_t, struct group *,\n\t\t\tchar *, size_t, struct group **);\n#endif\n#if defined __BSD_VISIBLE || defined _XOPEN_SOURCE_EXTENDED\nvoid\t\t setgrent (void);\n#if __XSI_VISIBLE >= 700\nstruct group\t*getgrent (void);\nvoid\t\t endgrent (void);\n#endif\n#endif\n#if defined __BSD_VISIBLE\nint\t\t initgroups (const char *, gid_t);\n#endif\n#ifndef __CYGWIN__\nvoid\t\t setgrfile (const char *); /* 4.3BSD-Reno & Minix */\nchar\t\t*group_from_gid (gid_t, int);\nint\t\t setgroupent (int); /* 4.3BSD-Reno & Mac OS X */\n#endif /* !__CYGWIN__ */\n#endif /* !__INSIDE_CYGWIN__ */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !_GRP_H_ */\n"},{"id":"280104","messageId":"56D7CAD0.8030405@ramsayjones.plus.com","threadId":"41563","inReplyTo":"56D7B07F.4010001@ramsayjones.plus.com","subject":"Re: Compiler warning under cygwin/mingw","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-03-03T05:25:36Z","receivedAt":"2016-03-03T05:25:36Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 03/03/16 03:33, Ramsay Jones wrote:\n> \n> \n> On 29/02/16 12:32, Ramsay Jones wrote:\n>>\n>>\n>> On 29/02/16 10:40, Torsten Bögershausen wrote:\n>>> That compiles OK, thanks.\n>>>\n>>>\n>>> Sorry for high-jacking this thread, but while compiling under CYGWIN,\n>>> found one warning:\n>>>\n>>>    LINK git-credential-store.exe\n>>>     CC daemon.o\n>>> daemon.c: In function ‘drop_privileges’:\n>>> daemon.c:1136:15: warning: implicit declaration of function ‘initgroups’ [-Wimplicit-function-declaration]\n>>>   if (cred && (initgroups(cred->pass->pw_name, cred->gid) ||\n>>\n>> Yeah, this has been there for a while - except it depends on which version\n>> of the header files you have. (Some may not see the warning).\n>>\n>> I have 'fixed' this twice before, then updated my installation and\n>> a change to the system headers broke it again! (The headers are\n>> currently 'broken'). So, I got tired of fixing it up and have left\n>> it a while - you never know a new update may fix it! ;-)\n>>\n>> [I personally don't use the git daemon on cygwin, so I don't know\n>> if this a problem in practice.]\n> \n> BTW, I forgot to mention that I have had a patch in my local repo for\n> ages which addresses this issue. However, although this patch fixes\n> the problem for me, with the header files I currently have installed, it\n> would just as easily _introduce_ this warning for those that don't\n> currently see it! ;-)\n> \n> I suppose that I could send a patch which sets NO_INITGROUPS in the\n> Makefile, until the system header files are fixed. What do you think?\n> \n> The correct solution is to fix the <grp.h> header file. I have been\n> a bit reluctant to tackle that, because I'm not familiar with the\n> cygwin project development process. Since Newlib is an upstream\n> project to cygwin, should I go there first/instead?\n> \n> Anyway, I had a quick squint at the header and I think it needs to\n> be changed something like the diff below. (I've also attached the\n> new grp.h file).\n> \n\nAnd, of course, I made a mess of it! It was only supposed to be a\n'something like this' patch, but still ... :-D\n\n> [Note: I didn't know what to do about _PATH_GROUP, setgrfile(),\n> group_from_gid() and setgroupent(), so I punted on those!]\n\nAlso, the comments on setgrfile() and setgroupent() were just notes\nto myself, which I didn't intend to send ...\n\nSo, more like the diff below.\n\nATB,\nRamsay Jones\n\n-- >8 --\ndiff --git a/usr/include/grp.h b/grp.h\nindex c3a5a67..c04fd63 100644\n--- a/usr/include/grp.h\n+++ b/grp.h\n@@ -67,25 +67,25 @@ extern \"C\" {\n #ifndef __INSIDE_CYGWIN__\n struct group\t*getgrgid (gid_t);\n struct group\t*getgrnam (const char *);\n+#if defined __POSIX_VISIBLE || defined __BSD_VISIBLE\n int\t\t getgrnam_r (const char *, struct group *,\n \t\t\tchar *, size_t, struct group **);\n int\t\t getgrgid_r (gid_t, struct group *,\n \t\t\tchar *, size_t, struct group **);\n-#ifndef _POSIX_SOURCE\n-struct group\t*getgrent (void);\n+#endif\n+#if defined __BSD_VISIBLE || defined __XSI_VISIBLE\n void\t\t setgrent (void);\n+struct group\t*getgrent (void);\n void\t\t endgrent (void);\n+#endif\n+#if defined __BSD_VISIBLE\n+int\t\t initgroups (const char *, gid_t);\n+#endif\n #ifndef __CYGWIN__\n void\t\t setgrfile (const char *);\n-#endif /* !__CYGWIN__ */\n-#ifndef _XOPEN_SOURCE\n-#ifndef __CYGWIN__\n char\t\t*group_from_gid (gid_t, int);\n int\t\t setgroupent (int);\n #endif /* !__CYGWIN__ */\n-int\t\t initgroups (const char *, gid_t);\n-#endif /* !_XOPEN_SOURCE */\n-#endif /* !_POSIX_SOURCE */\n #endif /* !__INSIDE_CYGWIN__ */\n \n #ifdef __cplusplus\n\n\n/*\t$NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $\t*/\n\n/*-\n * Copyright (c) 1989, 1993\n *\tThe Regents of the University of California.  All rights reserved.\n * (c) UNIX System Laboratories, Inc.\n * All or some portions of this file are derived from material licensed\n * to the University of California by American Telephone and Telegraph\n * Co. or Unix System Laboratories, Inc. and are reproduced herein with\n * the permission of UNIX System Laboratories, Inc.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *\tThis product includes software developed by the University of\n *\tCalifornia, Berkeley and its contributors.\n * 4. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n *\t@(#)grp.h\t8.2 (Berkeley) 1/21/94\n */\n\n#ifndef _GRP_H_\n#define\t_GRP_H_\n\n#include <sys/cdefs.h>\n#include <sys/types.h>\n#ifdef __CYGWIN__\n#include <cygwin/grp.h>\n#endif\n\n#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)\n#define\t_PATH_GROUP\t\t\"/etc/group\"\n#endif\n\nstruct group {\n\tchar\t*gr_name;\t\t/* group name */\n\tchar\t*gr_passwd;\t\t/* group password */\n\tgid_t\tgr_gid;\t\t\t/* group id */\n\tchar\t**gr_mem;\t\t/* group members */\n};\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef __INSIDE_CYGWIN__\nstruct group\t*getgrgid (gid_t);\nstruct group\t*getgrnam (const char *);\n#if defined __POSIX_VISIBLE || defined __BSD_VISIBLE\nint\t\t getgrnam_r (const char *, struct group *,\n\t\t\tchar *, size_t, struct group **);\nint\t\t getgrgid_r (gid_t, struct group *,\n\t\t\tchar *, size_t, struct group **);\n#endif\n#if defined __BSD_VISIBLE || defined __XSI_VISIBLE\nvoid\t\t setgrent (void);\nstruct group\t*getgrent (void);\nvoid\t\t endgrent (void);\n#endif\n#if defined __BSD_VISIBLE\nint\t\t initgroups (const char *, gid_t);\n#endif\n#ifndef __CYGWIN__\nvoid\t\t setgrfile (const char *);\nchar\t\t*group_from_gid (gid_t, int);\nint\t\t setgroupent (int);\n#endif /* !__CYGWIN__ */\n#endif /* !__INSIDE_CYGWIN__ */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !_GRP_H_ */\n"},{"id":"283246","messageId":"xmqqy48imn2e.fsf@gitster.mtv.corp.google.com","threadId":"41563","inReplyTo":"1456754714-25237-1-git-send-email-szeder@ira.uka.de","subject":"Re: Compiler warning under cygwin/mingw","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-12T23:20:25Z","receivedAt":"2016-04-12T23:20:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SZEDER Gábor <szeder@ira.uka.de> writes:\n\n> Hi,\n>\n>> > And MINGW is not happy for other reasons:\n>> >\n>> > builtin/rev-parse.c: In function 'cmd_rev_parse':\n>> > builtin/rev-parse.c:775:12: warning: implicit declaration of function\n>> > 'realpath' [-Wimplicit-function-declaration]\n>> >        if (!realpath(gitdir, absolute_path))\n>> >             ^\n>> \n>> I guess you're building \"pu\"; that is only in sg/completion-updates. I\n>> don't know if our custom real_path() would suffice there. You might want\n>> to ping the author. The patch is:\n>> \n>>   http://article.gmane.org/gmane.comp.version-control.git/287462\n>\n> Oh, I was not aware that there is a custom real_path() that is\n> preferred over the system realpath().  I don't see why our real_path()\n> would not suffice, it even makes the code a tad shorter.\n>\n> I will include the patch below in the reroll.\n\nA friendly ping to see if I am missing new development that followed\nthis message...\n\n>\n> Best,\n> Gábor\n>\n>\n>  ----  >8  ----\n> Subject: [PATCH] fixup! rev-parse: add '--absolute-git-dir' option\n>\n> ---\n>  builtin/rev-parse.c | 5 +----\n>  1 file changed, 1 insertion(+), 4 deletions(-)\n>\n> diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\n> index 90a4dd6032c0..d6d9a82c77c4 100644\n> --- a/builtin/rev-parse.c\n> +++ b/builtin/rev-parse.c\n> @@ -762,10 +762,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)\n>  \t\t\t\t\tif (!gitdir && !prefix)\n>  \t\t\t\t\t\tgitdir = \".git\";\n>  \t\t\t\t\tif (gitdir) {\n> -\t\t\t\t\t\tchar absolute_path[PATH_MAX];\n> -\t\t\t\t\t\tif (!realpath(gitdir, absolute_path))\n> -\t\t\t\t\t\t\tdie_errno(_(\"unable to get absolute path\"));\n> -\t\t\t\t\t\tputs(absolute_path);\n> +\t\t\t\t\t\tputs(real_path(gitdir));\n>  \t\t\t\t\t\tcontinue;\n>  \t\t\t\t\t}\n>  \t\t\t\t}\n"},{"id":"286093","messageId":"xmqqa8jxpy0l.fsf@gitster.mtv.corp.google.com","threadId":"41563","inReplyTo":"1456754714-25237-1-git-send-email-szeder@ira.uka.de","subject":"Re: [PATCH 0/6] modernize t1500","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-10T18:29:30Z","receivedAt":"2016-05-10T18:29:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n>   t1500: test_rev_parse: facilitate future test enhancements\n>   t1500: reduce dependence upon global state\n>   t1500: avoid changing working directory outside of tests\n>   t1500: avoid setting configuration options outside of tests\n>   t1500: avoid setting environment variables outside of tests\n>   t1500: be considerate to future potential tests\n\nWhen you reroll sg/completion-updates series (87a213f^..2be685a, 21\npatches), please pay attention to this series, as it changes the way\nyou would check the output from your \"--absolute-git-dir\" option.\n"}]}