{"thread":{"id":"40645","subject":"[PATCH 1/6] Only use CURLOPT_LOGIN_OPTIONS if it is actually available","startedAt":"2015-10-26T13:14:50Z","lastAt":"2015-11-18T06:52:28Z","messageCount":48,"participants":["Johannes Schindelin","Jonathan Nieder","Junio C Hamano","James McCoy","Duy Nguyen","Jeff King","Stefan Beller","Victor Leschuk","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"272235","messageId":"cover.1445865176.git.johannes.schindelin@gmx.de","threadId":"40645","inReplyTo":null,"subject":"[PATCH 0/6] Miscellaneous platform-independent patches from Git for Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-26T13:14:50Z","receivedAt":"2015-10-26T13:14:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"While working on Git for Windows 2.x, a couple of fixes were necessary\nthat are not actually specific to Windows.\n\nFor example, when stuck behind a faulty Access Point that somehow worked\nwith an Android phone, but not with this developer's MacBook, it was\nnecessary to use a SOCKS proxy via the phone to be able to continue\ndeveloping Git for Windows.\n\nThis is the first patch series attempting to lift the patches from Git\nfor Windows' friendly fork into upstream Git.\n\n\nJohannes Schindelin (4):\n  Only use CURLOPT_LOGIN_OPTIONS if it is actually available\n  Facilitate debugging Git executables in tests with gdb\n  Squelch warning about an integer overflow\n  Silence GCC's \"cast of pointer to integer of a different size\" warning\n\nPat Thoyts (1):\n  remote-http(s): Support SOCKS proxies\n\nWaldek Maleska (1):\n  Correct fscanf formatting string for I64u values\n\n builtin/gc.c           |  2 +-\n compat/regex/regcomp.c |  6 ++++--\n git-compat-util.h      |  6 +++++-\n http.c                 | 11 +++++++++++\n imap-send.c            |  4 ++++\n pack-revindex.c        |  2 +-\n sha1_file.c            |  2 +-\n wrap-for-bin.sh        |  7 +++++++\n 8 files changed, 34 insertions(+), 6 deletions(-)\n\n-- \n2.1.4\n"},{"id":"272234","messageId":"5693bb2d11ff096859d885d06b4ca860caf5e960.1445865176.git.johannes.schindelin@gmx.de","threadId":"40645","inReplyTo":"cover.1445865176.git.johannes.schindelin@gmx.de","subject":"[PATCH 1/6] Only use CURLOPT_LOGIN_OPTIONS if it is actually available","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-26T13:14:58Z","receivedAt":"2015-10-26T13:14:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This fixes the compilation on an older Linux that was used to debug\ntest failures when upgrading Git for Windows to Git v2.3.0.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n imap-send.c | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/imap-send.c b/imap-send.c\nindex e9faaea..4d3b773 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -1421,11 +1421,15 @@ static CURL *setup_curl(struct imap_server_conf *srvc)\n \tcurl_easy_setopt(curl, CURLOPT_PORT, server.port);\n \n \tif (server.auth_method) {\n+#if LIBCURL_VERSION_NUM < 0x072200\n+\t\twarning(\"No LOGIN_OPTIONS support in this cURL version\");\n+#else\n \t\tstruct strbuf auth = STRBUF_INIT;\n \t\tstrbuf_addstr(&auth, \"AUTH=\");\n \t\tstrbuf_addstr(&auth, server.auth_method);\n \t\tcurl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);\n \t\tstrbuf_release(&auth);\n+#endif\n \t}\n \n \tif (!server.use_ssl)\n-- \n2.1.4\n"},{"id":"272236","messageId":"bf218d020e24216f55d1514c4459e645b13ec075.1445865176.git.johannes.schindelin@gmx.de","threadId":"40645","inReplyTo":"cover.1445865176.git.johannes.schindelin@gmx.de","subject":"[PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-26T13:15:07Z","receivedAt":"2015-10-26T13:15:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Pat Thoyts <patthoyts@users.sourceforge.net>\n\nWith this patch we properly support SOCKS proxies, configured e.g. like\nthis:\n\n\tgit config http.proxy socks5://192.168.67.1:32767\n\nWithout this patch, Git mistakenly tries to use SOCKS proxies as if they\nwere HTTP proxies, resulting in a error message like:\n\n\tfatal: unable to access 'http://.../': Proxy CONNECT aborted\n\nThis patch was required to work behind a faulty AP and scraped from\nhttp://stackoverflow.com/questions/15227130/#15228479 and guarded with\nan appropriate cURL version check by Johannes Schindelin.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n http.c | 11 +++++++++++\n 1 file changed, 11 insertions(+)\n\ndiff --git a/http.c b/http.c\nindex 7da76ed..6b89dea 100644\n--- a/http.c\n+++ b/http.c\n@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)\n \n \tif (curl_http_proxy) {\n \t\tcurl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);\n+#if LIBCURL_VERSION_NUM >= 0x071800\n+\t\tif (starts_with(curl_http_proxy, \"socks5\"))\n+\t\t\tcurl_easy_setopt(result,\n+\t\t\t\tCURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);\n+\t\telse if (starts_with(curl_http_proxy, \"socks4a\"))\n+\t\t\tcurl_easy_setopt(result,\n+\t\t\t\tCURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);\n+\t\telse if (starts_with(curl_http_proxy, \"socks\"))\n+\t\t\tcurl_easy_setopt(result,\n+\t\t\t\tCURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);\n+#endif\n \t}\n #if LIBCURL_VERSION_NUM >= 0x070a07\n \tcurl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n-- \n2.1.4\n"},{"id":"272237","messageId":"082d6474a31c405b16087f76de7bc5d01faba529.1445865176.git.johannes.schindelin@gmx.de","threadId":"40645","inReplyTo":"cover.1445865176.git.johannes.schindelin@gmx.de","subject":"[PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-26T13:15:15Z","receivedAt":"2015-10-26T13:15:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it\nwill now be run with GDB, allowing the developer to debug test failures\nmore conveniently.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n wrap-for-bin.sh | 7 +++++++\n 1 file changed, 7 insertions(+)\n\ndiff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\nindex 701d233..a151c95 100644\n--- a/wrap-for-bin.sh\n+++ b/wrap-for-bin.sh\n@@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n \n+if test -n \"$TEST_GDB_GIT\"\n+then\n+\texec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n+\techo \"Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*\" >&2\n+\texit 1\n+fi\n+\n exec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n-- \n2.1.4\n"},{"id":"272239","messageId":"b0e4b6736cc2ec88e5f7cf587629d6a4d7e502d8.1445865176.git.johannes.schindelin@gmx.de","threadId":"40645","inReplyTo":"cover.1445865176.git.johannes.schindelin@gmx.de","subject":"[PATCH 4/6] Squelch warning about an integer overflow","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-26T13:15:21Z","receivedAt":"2015-10-26T13:15:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"We cannot rely on long integers to have more than 32 bits...\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-compat-util.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 805d0e2..610e8a5 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -568,7 +568,7 @@ extern int git_lstat(const char *, struct stat *);\n #endif\n \n #define DEFAULT_PACKED_GIT_LIMIT \\\n-\t((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))\n+\t((1024L * 1024L) * (size_t)(sizeof(void*) >= 8 ? 8192 : 256))\n \n #ifdef NO_PREAD\n #define pread git_pread\n-- \n2.1.4\n"},{"id":"272238","messageId":"acd0b0db0a608523f8ca8d7fa47319a296daf34a.1445865176.git.johannes.schindelin@gmx.de","threadId":"40645","inReplyTo":"cover.1445865176.git.johannes.schindelin@gmx.de","subject":"[PATCH 5/6] Silence GCC's \"cast of pointer to integer of a different size\" warning","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-26T13:15:25Z","receivedAt":"2015-10-26T13:15:25Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"When calculating hashes from pointers, it actually makes sense to cut\noff the most significant bits. In that case, said warning does not make\na whole lot of sense.\n\nSo let's just work around it.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/regex/regcomp.c | 6 ++++--\n pack-revindex.c        | 2 +-\n sha1_file.c            | 2 +-\n 3 files changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/compat/regex/regcomp.c b/compat/regex/regcomp.c\nindex 06f3088..fba5986 100644\n--- a/compat/regex/regcomp.c\n+++ b/compat/regex/regcomp.c\n@@ -18,6 +18,8 @@\n    Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n    02110-1301 USA.  */\n \n+#include <stdint.h>\n+\n static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,\n \t\t\t\t\t  size_t length, reg_syntax_t syntax);\n static void re_compile_fastmap_iter (regex_t *bufp,\n@@ -2577,7 +2579,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,\n     old_tree = NULL;\n \n   if (elem->token.type == SUBEXP)\n-    postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);\n+    postorder (elem, mark_opt_subexp, (void *) (intptr_t) elem->token.opr.idx);\n \n   tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT));\n   if (BE (tree == NULL, 0))\n@@ -3806,7 +3808,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,\n static reg_errcode_t\n mark_opt_subexp (void *extra, bin_tree_t *node)\n {\n-  int idx = (int) (long) extra;\n+  int idx = (int) (intptr_t) extra;\n   if (node->token.type == SUBEXP && node->token.opr.idx == idx)\n     node->token.opt_subexp = 1;\n \ndiff --git a/pack-revindex.c b/pack-revindex.c\nindex 5c8376e..e542ea7 100644\n--- a/pack-revindex.c\n+++ b/pack-revindex.c\n@@ -21,7 +21,7 @@ static int pack_revindex_hashsz;\n \n static int pack_revindex_ix(struct packed_git *p)\n {\n-\tunsigned long ui = (unsigned long)p;\n+\tunsigned long ui = (unsigned long)(intptr_t)p;\n \tint i;\n \n \tui = ui ^ (ui >> 16); /* defeat structure alignment */\ndiff --git a/sha1_file.c b/sha1_file.c\nindex 50896ff..c5b31de 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -2126,7 +2126,7 @@ static unsigned long pack_entry_hash(struct packed_git *p, off_t base_offset)\n {\n \tunsigned long hash;\n \n-\thash = (unsigned long)p + (unsigned long)base_offset;\n+\thash = (unsigned long)(intptr_t)p + (unsigned long)base_offset;\n \thash += (hash >> 8) + (hash >> 16);\n \treturn hash % MAX_DELTA_CACHE;\n }\n-- \n2.1.4\n"},{"id":"272240","messageId":"9f9e70a1704d8388f520535192e263089e36860e.1445865176.git.johannes.schindelin@gmx.de","threadId":"40645","inReplyTo":"cover.1445865176.git.johannes.schindelin@gmx.de","subject":"[PATCH 6/6] Correct fscanf formatting string for I64u values","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-26T13:15:33Z","receivedAt":"2015-10-26T13:15:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Waldek Maleska <w.maleska@gmail.com>\n\nThis fix is probably purely cosmetic because PRIuMAX is likely identical\nto SCNuMAX. Nevertheless, when using a function of the scanf() family,\nthe correct interpolation to use is the latter, not the former.\n\nSigned-off-by: Waldek Maleska <w.maleska@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin/gc.c      | 2 +-\n git-compat-util.h | 4 ++++\n 2 files changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex b677923..df3e454 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -240,7 +240,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)\n \t\t\t * running.\n \t\t\t */\n \t\t\ttime(NULL) - st.st_mtime <= 12 * 3600 &&\n-\t\t\tfscanf(fp, \"%\"PRIuMAX\" %127c\", &pid, locking_host) == 2 &&\n+\t\t\tfscanf(fp, \"%\"SCNuMAX\" %127c\", &pid, locking_host) == 2 &&\n \t\t\t/* be gentle to concurrent \"gc\" on remote hosts */\n \t\t\t(strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);\n \t\tif (fp != NULL)\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 610e8a5..87456a3 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -296,6 +296,10 @@ extern char *gitbasename(char *);\n #define PRIuMAX \"llu\"\n #endif\n \n+#ifndef SCNuMAX\n+#define SCNuMAX PRIuMAX\n+#endif\n+\n #ifndef PRIu32\n #define PRIu32 \"u\"\n #endif\n-- \n2.1.4\n"},{"id":"272254","messageId":"20151026191724.GE7881@google.com","threadId":"40645","inReplyTo":"082d6474a31c405b16087f76de7bc5d01faba529.1445865176.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2015-10-26T19:17:24Z","receivedAt":"2015-10-26T19:17:24Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Schindelin wrote:\n\n> When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it\n> will now be run with GDB, allowing the developer to debug test failures\n> more conveniently.\n\nNeat.\n\n[...]\n> --- a/wrap-for-bin.sh\n> +++ b/wrap-for-bin.sh\n> @@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n>  PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n>  export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n>  \n> +if test -n \"$TEST_GDB_GIT\"\n> +then\n> +\texec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n\nMost TEST_ environment variables that git respects are under\nGIT_TEST_* --- e.g., GIT_TEST_OPTS.  Should this match that pattern\nas well, for easier debugging with commands like 'env | grep GIT_'?\n\nWhat happens if the child in turn calls git again?  Should this\nunset TEST_GDB_GIT in gdb's environment?\n\nThe gdb manual and --help output advertise \"--args\".  Has \"-args\"\n(with a single dash) always worked?\n\n> +\techo \"Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*\" >&2\n> +\texit 1\n\nDoes the 'exec' after the fi need this as well?  exec is supposed to\nitself print a message and exit when it runs into an error.  Would\nincluding an 'else' with the if make the control flow clearer?  E.g.\n\n\tif test -n \"$TEST_GDB_GIT\"\n\tthen\n\t\texec gdb --args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n\telse\n\t\texec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n\tfi\n\nThanks,\nJonathan\n\ndiff --git i/wrap-for-bin.sh w/wrap-for-bin.sh\nindex a151c95..db0ec6a 100644\n--- i/wrap-for-bin.sh\n+++ w/wrap-for-bin.sh\n@@ -19,11 +19,10 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n \n-if test -n \"$TEST_GDB_GIT\"\n+if test -n \"$GIT_TEST_GDB\"\n then\n-\texec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n-\techo \"Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*\" >&2\n-\texit 1\n+\tunset GIT_TEST_GDB\n+\texec gdb --args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n+else\n+\texec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n fi\n-\n-exec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n"},{"id":"272262","messageId":"xmqq7fm9gze2.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"bf218d020e24216f55d1514c4459e645b13ec075.1445865176.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-26T20:15:17Z","receivedAt":"2015-10-26T20:15:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> This patch was required to work behind a faulty AP and scraped from\n> http://stackoverflow.com/questions/15227130/#15228479 and guarded with\n> an appropriate cURL version check by Johannes Schindelin.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThanks.\n\nThe code looks OK but the last paragraph makes _us_ worried.  What\nis the licensing status of the original at SO?  I can see that you\nare taking legal responsibility with the Signed-off-by: line; you\nstate that to the best of your knowledge the patch is covered under\nan appropriate open source license and you ahve the right under that\nlicense to submit it here to the project.\n\nBut it is my job to double check when in doubt, hence this question.\n\n> ---\n>  http.c | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n>\n> diff --git a/http.c b/http.c\n> index 7da76ed..6b89dea 100644\n> --- a/http.c\n> +++ b/http.c\n> @@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)\n>  \n>  \tif (curl_http_proxy) {\n>  \t\tcurl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);\n> +#if LIBCURL_VERSION_NUM >= 0x071800\n> +\t\tif (starts_with(curl_http_proxy, \"socks5\"))\n> +\t\t\tcurl_easy_setopt(result,\n> +\t\t\t\tCURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);\n> +\t\telse if (starts_with(curl_http_proxy, \"socks4a\"))\n> +\t\t\tcurl_easy_setopt(result,\n> +\t\t\t\tCURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);\n> +\t\telse if (starts_with(curl_http_proxy, \"socks\"))\n> +\t\t\tcurl_easy_setopt(result,\n> +\t\t\t\tCURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);\n> +#endif\n>  \t}\n>  #if LIBCURL_VERSION_NUM >= 0x070a07\n>  \tcurl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n"},{"id":"272263","messageId":"xmqq37wxgz9v.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"5693bb2d11ff096859d885d06b4ca860caf5e960.1445865176.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 1/6] Only use CURLOPT_LOGIN_OPTIONS if it is actually available","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-26T20:17:48Z","receivedAt":"2015-10-26T20:17:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.  Makes sense.  It probably needs to have imap-send early on\nthe title, though (will locally amend, so no need to resend).\n"},{"id":"272264","messageId":"xmqqy4epfkl3.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"9f9e70a1704d8388f520535192e263089e36860e.1445865176.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 6/6] Correct fscanf formatting string for I64u values","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-26T20:20:24Z","receivedAt":"2015-10-26T20:20:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; will queue.\n"},{"id":"272265","messageId":"xmqqtwpdfkk8.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"acd0b0db0a608523f8ca8d7fa47319a296daf34a.1445865176.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 5/6] Silence GCC's \"cast of pointer to integer of a different size\" warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-26T20:20:55Z","receivedAt":"2015-10-26T20:20:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"OK.  Will queue.  Thanks.\n"},{"id":"272266","messageId":"xmqqpp01fkg5.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"b0e4b6736cc2ec88e5f7cf587629d6a4d7e502d8.1445865176.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 4/6] Squelch warning about an integer overflow","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-26T20:23:22Z","receivedAt":"2015-10-26T20:23:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> We cannot rely on long integers to have more than 32 bits...\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n\nInteresting.  8192 * 1024 * 1024 does not fit within 32-bit long, of\ncourse.  Perhaps we can lose L after 1024 if we are explicitly\nsaying that the result ought to be size_t (which may be larger than\nlong)?\n\n>  git-compat-util.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git-compat-util.h b/git-compat-util.h\n> index 805d0e2..610e8a5 100644\n> --- a/git-compat-util.h\n> +++ b/git-compat-util.h\n> @@ -568,7 +568,7 @@ extern int git_lstat(const char *, struct stat *);\n>  #endif\n>  \n>  #define DEFAULT_PACKED_GIT_LIMIT \\\n> -\t((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))\n> +\t((1024L * 1024L) * (size_t)(sizeof(void*) >= 8 ? 8192 : 256))\n>  \n>  #ifdef NO_PREAD\n>  #define pread git_pread\n"},{"id":"272283","messageId":"20151027012336.GK31271@freya.jamessan.com","threadId":"40645","inReplyTo":"xmqq7fm9gze2.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"James McCoy","fromEmail":"vega.james@gmail.com","sentAt":"2015-10-27T01:23:36Z","receivedAt":"2015-10-27T01:23:36Z","isPatch":true,"sender":{"key":"vega.james@gmail.com","avatar":"https://avatars.githubusercontent.com/u/112971?v=4"},"body":"On Mon, Oct 26, 2015 at 01:15:17PM -0700, Junio C Hamano wrote:\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > This patch was required to work behind a faulty AP and scraped from\n> > http://stackoverflow.com/questions/15227130/#15228479 and guarded with\n> > an appropriate cURL version check by Johannes Schindelin.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> Thanks.\n> \n> The code looks OK but the last paragraph makes _us_ worried.  What\n> is the licensing status of the original at SO?\n\nAccording to Stackoverflow[0],\n\n  As noted in the Stack Exchange Terms of Service[1] and in the footer of\n  every page, all user contributions are licensed under Creative Commons\n  Attribution-Share Alike[2]. Proper attribution[3] is required if you\n  republish any Stack Exchange content.\n\n[0]: https://stackoverflow.com/help/licensing\n[1]: http://stackexchange.com/legal\n[2]: http://creativecommons.org/licenses/by-sa/3.0/\n[3]: http://blog.stackoverflow.com/2009/06/attribution-required/\n\nCheers,\n-- \nJames\nGPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <vega.james@gmail.com>\n"},{"id":"272284","messageId":"xmqqvb9tdr7v.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"20151027012336.GK31271@freya.jamessan.com","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-27T01:40:04Z","receivedAt":"2015-10-27T01:40:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"James McCoy <vega.james@gmail.com> writes:\n\n>> The code looks OK but the last paragraph makes _us_ worried.  What\n>> is the licensing status of the original at SO?\n>\n> According to Stackoverflow[0],\n>\n>   As noted in the Stack Exchange Terms of Service[1] and in the footer of\n>   every page, all user contributions are licensed under Creative Commons\n>   Attribution-Share Alike[2]. Proper attribution[3] is required if you\n>   republish any Stack Exchange content.\n>\n> [0]: https://stackoverflow.com/help/licensing\n\nYes, and (please correct me if I am wrong--this is one of the times\nI hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,\nin which case we cannot use this patch (instead somebody has to\nreimplement the same without copying).\n"},{"id":"272296","messageId":"alpine.DEB.1.00.1510271036100.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"20151026191724.GE7881@google.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-27T09:42:29Z","receivedAt":"2015-10-27T09:42:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Mon, 26 Oct 2015, Jonathan Nieder wrote:\n\n> Johannes Schindelin wrote:\n> \n> > --- a/wrap-for-bin.sh\n> > +++ b/wrap-for-bin.sh\n> > @@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n> >  PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n> >  export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n> >  \n> > +if test -n \"$TEST_GDB_GIT\"\n> > +then\n> > +\texec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> \n> Most TEST_ environment variables that git respects are under\n> GIT_TEST_* --- e.g., GIT_TEST_OPTS.  Should this match that pattern\n> as well, for easier debugging with commands like 'env | grep GIT_'?\n\nI dunno. This variable is most useful when inserted into the shell scripts\nin t/ themselves, not when specified via the command line. For example, if\nyou have something like\n\n\ttest_expect_success '123' '\n\t\t...\n\t\t# This Git call somehow fails and I have no clue why\n\t\tgit push remote HEAD\n\t\t...\n\t'\n\nthen prefixing the `git push` command with `TEST_GDB_GIT=1` lets you use\n`gdb` when running the test with the `-i` and `-v` flags.\n\nPlease note that `TEST_GDB_GIT` is already a major step up from my initial\n`DDD`.\n\n> What happens if the child in turn calls git again?  Should this\n> unset TEST_GDB_GIT in gdb's environment?\n\nIt probably would call gdb again. Which is sometimes useful. But I have to\nadmit that I do not know whether that works.\n\n> The gdb manual and --help output advertise \"--args\".  Has \"-args\"\n> (with a single dash) always worked?\n\nI always used it with a single dash... So I assume that it worked for a\nlong time (IIRC I used it first in 1994).\n\n> > +\techo \"Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*\" >&2\n> > +\texit 1\n> \n> Does the 'exec' after the fi need this as well?  exec is supposed to\n> itself print a message and exit when it runs into an error.  Would\n> including an 'else' with the if make the control flow clearer?  E.g.\n> \n> \tif test -n \"$TEST_GDB_GIT\"\n> \tthen\n> \t\texec gdb --args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> \telse\n> \t\texec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> \tfi\n\nI suppose you're right! The `exec` can fail easily, e.g. when `gdb` was\nnot found.\n\nCiao,\nJohannes\n"},{"id":"272311","messageId":"alpine.DEB.1.00.1510271649430.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"xmqqvb9tdr7v.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-27T15:50:37Z","receivedAt":"2015-10-27T15:50:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 26 Oct 2015, Junio C Hamano wrote:\n\n> James McCoy <vega.james@gmail.com> writes:\n> \n> >> The code looks OK but the last paragraph makes _us_ worried.  What\n> >> is the licensing status of the original at SO?\n> >\n> > According to Stackoverflow[0],\n> >\n> >   As noted in the Stack Exchange Terms of Service[1] and in the footer of\n> >   every page, all user contributions are licensed under Creative Commons\n> >   Attribution-Share Alike[2]. Proper attribution[3] is required if you\n> >   republish any Stack Exchange content.\n> >\n> > [0]: https://stackoverflow.com/help/licensing\n> \n> Yes, and (please correct me if I am wrong--this is one of the times\n> I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,\n> in which case we cannot use this patch (instead somebody has to\n> reimplement the same without copying).\n\nPat, could you please allow us to insert your SOB?\n\nThanks,\nDscho\n"},{"id":"272312","messageId":"alpine.DEB.1.00.1510271651420.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510271649430.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-27T15:53:34Z","receivedAt":"2015-10-27T15:53:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Oct 2015, Johannes Schindelin wrote:\n\n> On Mon, 26 Oct 2015, Junio C Hamano wrote:\n> \n> > James McCoy <vega.james@gmail.com> writes:\n> > \n> > >> The code looks OK but the last paragraph makes _us_ worried.  What\n> > >> is the licensing status of the original at SO?\n> > >\n> > > According to Stackoverflow[0],\n> > >\n> > >   As noted in the Stack Exchange Terms of Service[1] and in the footer of\n> > >   every page, all user contributions are licensed under Creative Commons\n> > >   Attribution-Share Alike[2]. Proper attribution[3] is required if you\n> > >   republish any Stack Exchange content.\n> > >\n> > > [0]: https://stackoverflow.com/help/licensing\n> > \n> > Yes, and (please correct me if I am wrong--this is one of the times\n> > I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,\n> > in which case we cannot use this patch (instead somebody has to\n> > reimplement the same without copying).\n> \n> Pat, could you please allow us to insert your SOB?\n\nOn second thought... Junio, could you please sanity-check my claim that\nthis patch:\n\n-- snip --\n@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)\n \n        if (curl_http_proxy) {\n                curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);\n+#if LIBCURL_VERSION_NUM >= 0x071800\n+               if (starts_with(curl_http_proxy, \"socks5\"))\n+                       curl_easy_setopt(result,\n+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);\n+               else if (starts_with(curl_http_proxy, \"socks4a\"))\n+                       curl_easy_setopt(result,\n+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);\n+               else if (starts_with(curl_http_proxy, \"socks\"))\n+                       curl_easy_setopt(result,\n+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);\n+#endif\n        }\n #if LIBCURL_VERSION_NUM >= 0x070a07\n        curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n-- snap --\n\ncannot be copyrighted because it is pretty much the only way to implement\nsaid functionality?\n\nStill, Pat, if you find the time, could you please simply relicense your\npatch (I know that you are fine with it, but we need an explicit\nstatement)?\n\nCiao,\nJohannes\n"},{"id":"272313","messageId":"xmqqr3kge0d3.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510271036100.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-27T16:34:48Z","receivedAt":"2015-10-27T16:34:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Most TEST_ environment variables that git respects are under\n>> GIT_TEST_* --- e.g., GIT_TEST_OPTS.  Should this match that pattern\n>> as well, for easier debugging with commands like 'env | grep GIT_'?\n>\n> I dunno. This variable is most useful when inserted into the shell scripts\n> in t/ themselves, not when specified via the command line. For example, if\n> you have something like\n>\n> \ttest_expect_success '123' '\n> \t\t...\n> \t\t# This Git call somehow fails and I have no clue why\n> \t\tgit push remote HEAD\n> \t\t...\n> \t'\n>\n> then prefixing the `git push` command with `TEST_GDB_GIT=1` lets you use\n> `gdb` when running the test with the `-i` and `-v` flags.\n>\n> Please note that `TEST_GDB_GIT` is already a major step up from my initial\n> `DDD`.\n\nYeah, that was my first reaction when I saw this patch.  Instead of\nhaving to munge that line to \"gdb -whatever-args git\", you can do a\nsingle-shot debugging in a convenient way.  And quite honestly,\nbecause nobody sane will run:\n\n     $ cd t && TEST_GDB_GIT=1 sh ./t1234-frotz.sh\n\nand can drive all the \"git\" running under gdb at the same time, I\nthink what you showed would be the _only_ practical use case.  I\nwould have thought that TEST_GDB_GIT was way too long (and so is\nGIT_TEST_GDB) and was about to suggest using something short and\nsweet, even shorter than DDD, that you can easily add and remove.\n\nIt can be called GDB=1, perhaps?\n\nI agree with all other points Jonathan made in his review, including\n\"Neat.\" part ;-)\n\nThanks.\n"},{"id":"272315","messageId":"xmqq8u6odxxx.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510271651420.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-27T17:27:06Z","receivedAt":"2015-10-27T17:27:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On second thought... Junio, could you please sanity-check my claim that\n> this patch:\n>\n> -- snip --\n> ...\n> -- snap --\n>\n> cannot be copyrighted because it is pretty much the only way to implement\n> said functionality?\n\nI am not a lawyer, so...\n\n\n> Still, Pat, if you find the time, could you please simply relicense your\n> patch (I know that you are fine with it, but we need an explicit\n> statement)?\n>\n> Ciao,\n> Johannes\n"},{"id":"272319","messageId":"CACsJy8C94gzE0CQH=f5=qeMj=DnE3bJ3EnLYbhxgrTG=W4r89A@mail.gmail.com","threadId":"40645","inReplyTo":"082d6474a31c405b16087f76de7bc5d01faba529.1445865176.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-10-27T18:09:12Z","receivedAt":"2015-10-27T18:09:12Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Oct 26, 2015 at 2:15 PM, Johannes Schindelin\n<johannes.schindelin@gmx.de> wrote:\n> When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it\n> will now be run with GDB, allowing the developer to debug test failures\n> more conveniently.\n\nI'm very slowly catching up with git traffic. Apologies if it's\nalready mentioned elsewhere since I have only read this mail thread.\n\nIs it more convenient to add a sh function \"gdb\" instead? Most of the\ntime I only want to stop one command, and I put \"gdb /path/..../\" in\nfront of \"git ...\". This gdb function could just expand to that THis\nwould make it a lot more convenient to debug (single command, not full\n.sh file).\n\nWe can even go further with supporting gdbserver function, to launch\ngdbserver, then I can debug from outside, works even without -v -i.\n-- \nDuy\n"},{"id":"272337","messageId":"xmqqbnbkp0e8.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"xmqq8u6odxxx.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-27T19:38:39Z","receivedAt":"2015-10-27T19:38:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>> On second thought... Junio, could you please sanity-check my claim that\n>> this patch:\n>>\n>> -- snip --\n>> ...\n>> -- snap --\n>>\n>> cannot be copyrighted because it is pretty much the only way to implement\n>> said functionality?\n>\n> I am not a lawyer, so...\n>\n>\n>> Still, Pat, if you find the time, could you please simply relicense your\n>> patch (I know that you are fine with it, but we need an explicit\n>> statement)?\n\nSo, I talked to our lawyer.\n\nWe are very lucky that the original was posted to SO by our friend\nPat, and you did the right thing to ask Pat to relicense.\n\nAnalyzing copyrightability is often more costly than the risk.  Even\nif you believe it is not copyrightable, you are bearing the risk\nthat the court may disagree with you.  Finding a different way to\nexpress the same idea, especially for a small patch like this, is\noften cheaper than the cost of copyrightability analysis and the\nrisk of lawsuit.\n\nIf the original is from a friendly party, relicensing is clearly\ncheaper and cleaner of the possible choices.\n"},{"id":"272342","messageId":"xmqqegggnhz7.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"xmqqbnbkp0e8.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-27T21:01:48Z","receivedAt":"2015-10-27T21:01:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Analyzing copyrightability is often more costly than the risk.\n\nMisspelled, obviously: \"more costly than the other ways to mitigate\nthe risk\" is what I meant.\n"},{"id":"272359","messageId":"20151027232848.GA4172@sigill.intra.peff.net","threadId":"40645","inReplyTo":"xmqqr3kge0d3.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-10-27T23:28:49Z","receivedAt":"2015-10-27T23:28:49Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 27, 2015 at 09:34:48AM -0700, Junio C Hamano wrote:\n\n> Yeah, that was my first reaction when I saw this patch.  Instead of\n> having to munge that line to \"gdb -whatever-args git\", you can do a\n> single-shot debugging in a convenient way.  And quite honestly,\n> because nobody sane will run:\n> \n>      $ cd t && TEST_GDB_GIT=1 sh ./t1234-frotz.sh\n> \n> and can drive all the \"git\" running under gdb at the same time, I\n> think what you showed would be the _only_ practical use case.\n\nI agree doing so would be crazy. But would:\n\n  ./t1234-frotz.sh --gdb=17\n\nbe sane to run gdb only inside test 17?\n\nI suspect it would work about half the time. Many tests will call git\nonly once per snippet, but many make multiple git calls, and we are only\ninterested in debugging one.\n\nI dunno. Maybe that is making things more complicated than they need to\nbe. I usually use the \"tweak the test script\" approach, but I have\nalways found it annoying to have to untweak it later.\n\n-Peff\n"},{"id":"272361","messageId":"CAGZ79karRbOTSEfFHRU6MG21T1L5GyuZW2ATqfdP4NE7wHMmHQ@mail.gmail.com","threadId":"40645","inReplyTo":"20151027232848.GA4172@sigill.intra.peff.net","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-10-27T23:39:37Z","receivedAt":"2015-10-27T23:39:37Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Oct 27, 2015 at 4:28 PM, Jeff King <peff@peff.net> wrote:\n> I agree doing so would be crazy. But would:\n>\n>   ./t1234-frotz.sh --gdb=17\n>\n> be sane to run gdb only inside test 17?\n\nOT:\nWe have two ways of addressing tests, by number and by name.\nUsually when a test fails (\"Foo gobbles the bar correctly\" failed),\nI want to run tests 1,17 (1 is the correct setup and 17 is the failing test)\nBut coming up with that tuple is hard.\n  * How do I know we need to run 1 as the setup ? (usually we do,\n    sometimes we don't and other times we also need 2,3 to completely\nsetup the tests)\n  * How do I know it's test 17 which is failing? My workflow up to now\n    I just searched the test title in the file, such that I'd be there anyway\n    to inspect it further. But still I found it inconvenient to\nmentally map between\n    17 and the test title.\n\nStefan\n"},{"id":"272365","messageId":"20151027235823.GD4172@sigill.intra.peff.net","threadId":"40645","inReplyTo":"CAGZ79karRbOTSEfFHRU6MG21T1L5GyuZW2ATqfdP4NE7wHMmHQ@mail.gmail.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-10-27T23:58:24Z","receivedAt":"2015-10-27T23:58:24Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 27, 2015 at 04:39:37PM -0700, Stefan Beller wrote:\n\n> On Tue, Oct 27, 2015 at 4:28 PM, Jeff King <peff@peff.net> wrote:\n> > I agree doing so would be crazy. But would:\n> >\n> >   ./t1234-frotz.sh --gdb=17\n> >\n> > be sane to run gdb only inside test 17?\n> \n> OT:\n> We have two ways of addressing tests, by number and by name.\n\nYeah. The numbers are not stable if the script gets new test, but they\nare usually fine for within a debugging session. Names are annoying to\ntype (and also not guaranteed unique).\n\n> Usually when a test fails (\"Foo gobbles the bar correctly\" failed),\n> I want to run tests 1,17 (1 is the correct setup and 17 is the failing test)\n> But coming up with that tuple is hard.\n>   * How do I know we need to run 1 as the setup ? (usually we do,\n>     sometimes we don't and other times we also need 2,3 to completely\n> setup the tests)\n\nI think trying to deduce that tuple is a fool's errand. It takes a lot\nof manual work, and even if you _think_ you have it, sometimes state\nleft from earlier tests is accidentally important. But it's usually not\nthat expensive to run earlier tests at all; it's just expensive to run\nthem with extra debugging. That's why we have options like\n\"--valgrind-only=17\". We still _run_ tests 1..16, but we do it quickly,\nand then execute the expensive and slow valgrind git only on the\nsuspicious one.\n\nAnd I'd propose --gdb to work the same way (run all the other tests, but\nonly kick in gdb for the suspicious one).\n\nIf you had multiple \"git\" invocations inside test 17, you could even do\nsomething like \"--gdb=17:4\" to kick in only for the 4th git invocation\nor something. But counting up git invocations is probably too irritating\nto be worth doing manually.\n\n>   * How do I know it's test 17 which is failing? My workflow up to now\n>     I just searched the test title in the file, such that I'd be there anyway\n>     to inspect it further. But still I found it inconvenient to\n> mentally map between\n>     17 and the test title.\n\nI usually just run the test script and look at the output. Here's a\nfailure (which I obviously induced with an extra line):\n\n  $ ./t4103-apply-binary.sh -v -i\n  [...]\n  ok 5 - check binary diff -- should fail.\n  \n  expecting success: \n          git checkout master &&\n          echo whoops, we fail here && false &&\n          test_must_fail git apply --check C.diff\n  \n  Already on 'master'\n  whoops, we fail here\n  not ok 6 - check binary diff (copy) -- should fail.\n  #\n  #               git checkout master &&\n  #               echo whoops, we fail here && false &&\n  #               test_must_fail git apply --check C.diff\n  #\n\nI'd pull the test number from the \"not ok\" above (it's actually even\neasier to see if you drop the \"-v\", but I usually start my debugging\nwith \"-v\" anyway, since error messages often make the problem obvious).\n\n-Peff\n"},{"id":"272474","messageId":"5631AB75.5030800@gmail.com","threadId":"40645","inReplyTo":"082d6474a31c405b16087f76de7bc5d01faba529.1445865176.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Victor Leschuk","fromEmail":"vleschuk@gmail.com","sentAt":"2015-10-29T05:15:33Z","receivedAt":"2015-10-29T05:15:33Z","isPatch":true,"sender":{"key":"vleschuk@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1045374?v=4"},"body":"\n>   \n> +if test -n \"$TEST_GDB_GIT\"\n> +then\n> +\texec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\nMaybe we could make $TEST_GDB_GIT not just a boolean flag? It would be \nuseful to contain \"gdb\" executable name. It would allow to set path to \nGDB when it is not in $PATH, set different debuggers (for example, I \nusually use cgdb), or even set it to /path/to/gdb_wrapper.sh which could \ncontain different gdb options and tunings.\n\n--\nVictor\n"},{"id":"272484","messageId":"xmqqpozxsjyc.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"CACsJy8C94gzE0CQH=f5=qeMj=DnE3bJ3EnLYbhxgrTG=W4r89A@mail.gmail.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-29T16:44:43Z","receivedAt":"2015-10-29T16:44:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> On Mon, Oct 26, 2015 at 2:15 PM, Johannes Schindelin\n> <johannes.schindelin@gmx.de> wrote:\n>> When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it\n>> will now be run with GDB, allowing the developer to debug test failures\n>> more conveniently.\n>\n> I'm very slowly catching up with git traffic. Apologies if it's\n> already mentioned elsewhere since I have only read this mail thread.\n>\n> Is it more convenient to add a sh function \"gdb\" instead?\n\nChanging a line of git invocation you want to debug from\n\n\tgit frotz &&\n\nto\n\n\tdebug git frotz &&\n\nindeed is slightly more pleasing to the eye than\n\n\tTEST_GDB_GIT=1 git frotz &&\n\nI do not terribly care either way, as long as that feature is\navailble ;-)\n\nEither way these tweaks are temporary changes we make while figuring\nout where things go wrong, and from that point of view, (1) the\nlonger and more cumbersome to type, the more cumbersome to use, but\n(2) the longer and more visually identifiable, the easier to spot in\n\"diff\" a tweak you forgot to revert before committing.\n\n> We can even go further with supporting gdbserver function, to launch\n> gdbserver, then I can debug from outside, works even without -v -i.\n\nYes, that may be useful, but you can do so whether you use your\nshell function or TEST_GDB_GIT=1 that trigeers inside the \"git\"\nwrapper in bin-wrappers, I would think.\n"},{"id":"272544","messageId":"alpine.DEB.1.00.1510301918320.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"xmqqpp01fkg5.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 4/6] Squelch warning about an integer overflow","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-30T18:18:57Z","receivedAt":"2015-10-30T18:18:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 26 Oct 2015, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > We cannot rely on long integers to have more than 32 bits...\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> \n> Interesting.  8192 * 1024 * 1024 does not fit within 32-bit long, of\n> course.  Perhaps we can lose L after 1024 if we are explicitly\n> saying that the result ought to be size_t (which may be larger than\n> long)?\n\nSure. But it would make the patch harder to read.\n\nDo you insist?\n\nCiao,\nDscho\n"},{"id":"272546","messageId":"xmqqpozwkyj2.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510301918320.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 4/6] Squelch warning about an integer overflow","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-30T18:21:37Z","receivedAt":"2015-10-30T18:21:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Junio,\n>\n> On Mon, 26 Oct 2015, Junio C Hamano wrote:\n>\n>> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n>> \n>> > We cannot rely on long integers to have more than 32 bits...\n>> >\n>> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> > ---\n>> \n>> Interesting.  8192 * 1024 * 1024 does not fit within 32-bit long, of\n>> course.  Perhaps we can lose L after 1024 if we are explicitly\n>> saying that the result ought to be size_t (which may be larger than\n>> long)?\n>\n> Sure. But it would make the patch harder to read.\n>\n> Do you insist?\n\nNot at all.  I think the series is already in 'next', and if I\nhaven't merged it yet, I should.\n"},{"id":"272548","messageId":"alpine.DEB.1.00.1510301923010.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"20151027232848.GA4172@sigill.intra.peff.net","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-30T18:25:24Z","receivedAt":"2015-10-30T18:25:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Peff,\n\nOn Tue, 27 Oct 2015, Jeff King wrote:\n\n> On Tue, Oct 27, 2015 at 09:34:48AM -0700, Junio C Hamano wrote:\n> \n> > Yeah, that was my first reaction when I saw this patch.  Instead of\n> > having to munge that line to \"gdb -whatever-args git\", you can do a\n> > single-shot debugging in a convenient way.  And quite honestly,\n> > because nobody sane will run:\n> > \n> >      $ cd t && TEST_GDB_GIT=1 sh ./t1234-frotz.sh\n> > \n> > and can drive all the \"git\" running under gdb at the same time, I\n> > think what you showed would be the _only_ practical use case.\n> \n> I agree doing so would be crazy. But would:\n> \n>   ./t1234-frotz.sh --gdb=17\n> \n> be sane to run gdb only inside test 17?\n\nIt would probably be sane, but I never encountered the need for something\nlike that. It was always much easier to run the test using `sh -x t... -i\n-v` to find out what command was behaving funnily (mind you, that can be a\npretty hard thing todo, we have some quite convoluted test scripts in our\ncode base) and then edit the test.\n\nI would expect that `--gdb=<n>` thing to drive me crazy: first, I would\nchoose the wrong number. Next, I would probably forget that test_commit\nand other commands *also* calls Git.\n\nCiao,\nDscho\n"},{"id":"272549","messageId":"alpine.DEB.1.00.1510301925360.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"xmqqr3kge0d3.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-30T18:27:34Z","receivedAt":"2015-10-30T18:27:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 27 Oct 2015, Junio C Hamano wrote:\n\n> It can be called GDB=1, perhaps?\n\nNo, this is way too generic. As I only test that the environment\nvariable's existence, even something like GDB=/usr/opt/gdb/bin/gdb would\ntrigger it.\n\nI could be talked into GDB_GIT=1, though.\n\nCiao,\nDscho\n"},{"id":"272551","messageId":"alpine.DEB.1.00.1510301929020.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510271036100.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-30T18:31:13Z","receivedAt":"2015-10-30T18:31:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Tue, 27 Oct 2015, Johannes Schindelin wrote:\n\n> On Mon, 26 Oct 2015, Jonathan Nieder wrote:\n> \n> > Does the 'exec' after the fi need this as well?  exec is supposed to\n> > itself print a message and exit when it runs into an error.  Would\n> > including an 'else' with the if make the control flow clearer?  E.g.\n> > \n> > \tif test -n \"$TEST_GDB_GIT\"\n> > \tthen\n> > \t\texec gdb --args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> > \telse\n> > \t\texec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> > \tfi\n> \n> I suppose you're right! The `exec` can fail easily, e.g. when `gdb` was\n> not found.\n\nActually, after reading the patch again, I think it is better to be less\nintrusive and add the error message *just* for the gdb case, as it is\nright now:\n\n-- snipsnap --\n export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n \n+if test -n \"$TEST_GDB_GIT\"\n+then\n+       exec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n+       echo \"Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*\" >&2\n+       exit 1\n+fi\n+\n exec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n"},{"id":"272552","messageId":"xmqqlhakky0e.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510301925360.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-30T18:32:49Z","receivedAt":"2015-10-30T18:32:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Junio,\n>\n> On Tue, 27 Oct 2015, Junio C Hamano wrote:\n>\n>> It can be called GDB=1, perhaps?\n>\n> No, this is way too generic. As I only test that the environment\n> variable's existence, even something like GDB=/usr/opt/gdb/bin/gdb would\n> trigger it.\n>\n> I could be talked into GDB_GIT=1, though.\n\nAs I said in another message, I have no preference myself over the\nname of this variable (or making it a shell function like Duy\nmentioned, which incidentally may give us more visual pleasantness\nby losing '=').\n\nI'd just be happy as long as the feature becomes available, and I'd\nleave the choice of consistent and convenient naming to others who\nhave stronger opinions ;-)\n"},{"id":"272555","messageId":"alpine.DEB.1.00.1510301931450.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"xmqqbnbkp0e8.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-30T18:38:59Z","receivedAt":"2015-10-30T18:38:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 27 Oct 2015, Junio C Hamano wrote:\n\n> We are very lucky that the original was posted to SO by our friend\n> Pat, and you did the right thing to ask Pat to relicense.\n\nI suspect Pat is on a six month trip around the globe or something,\njudging from the feedback I got here:\n\n\thttps://github.com/patthoyts/git-gui/pull/1\n\nCiao,\nDscho\n"},{"id":"272556","messageId":"alpine.DEB.1.00.1510301941170.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"5631AB75.5030800@gmail.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-30T18:42:11Z","receivedAt":"2015-10-30T18:42:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Victor,\n\nOn Thu, 29 Oct 2015, Victor Leschuk wrote:\n\n> >   +if test -n \"$TEST_GDB_GIT\"\n> > +then\n> > +\texec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> Maybe we could make $TEST_GDB_GIT not just a boolean flag? It would be useful\n> to contain \"gdb\" executable name. It would allow to set path to GDB when it\n> is not in $PATH, set different debuggers (for example, I usually use cgdb),\n> or even set it to /path/to/gdb_wrapper.sh which could contain different gdb\n> options and tunings.\n\nSure, as long as TEST_GDB_GIT=1 still works. Why don't you make an add-on\npatch and submit it?\n\nCiao,\nJohannes\n"},{"id":"272558","messageId":"20151030185529.GH7881@google.com","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510301929020.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2015-10-30T18:55:29Z","receivedAt":"2015-10-30T18:55:29Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Schindelin wrote:\n> On Tue, 27 Oct 2015, Johannes Schindelin wrote:\n>> On Mon, 26 Oct 2015, Jonathan Nieder wrote:\n\n>>> Does the 'exec' after the fi need this as well?  exec is supposed to\n>>> itself print a message and exit when it runs into an error.\n[...]\n> Actually, after reading the patch again, I think it is better to be less\n> intrusive and add the error message *just* for the gdb case, as it is\n> right now:\n\nWhy?  Unlike the C library function of the same name, the shell\nbuiltin 'exec' prints an error message and exits on error.\n\nSorry for the lack of clarity,\nJonathan\n"},{"id":"272559","messageId":"20151030190256.GI7881@google.com","threadId":"40645","inReplyTo":"xmqqlhakky0e.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2015-10-30T19:02:56Z","receivedAt":"2015-10-30T19:02:56Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>> On Tue, 27 Oct 2015, Junio C Hamano wrote:\n\n>>> It can be called GDB=1, perhaps?\n>>\n>> No, this is way too generic. As I only test that the environment\n>> variable's existence, even something like GDB=/usr/opt/gdb/bin/gdb would\n>> trigger it.\n>>\n>> I could be talked into GDB_GIT=1, though.\n>\n> As I said in another message, I have no preference myself over the\n> name of this variable (or making it a shell function like Duy\n> mentioned, which incidentally may give us more visual pleasantness\n> by losing '=').\n>\n> I'd just be happy as long as the feature becomes available, and I'd\n> leave the choice of consistent and convenient naming to others who\n> have stronger opinions ;-)\n\nHere's a suggested patch.\n\n-- >8 --\nFrom: Johannes Schindelin <johannes.schindelin@gmx.de>\nSubject: Facilitate debugging Git executables in tests with gdb\n\nWhen prefixing a Git call in the test suite with 'debug ', it will now\nbe run with GDB, allowing the developer to debug test failures more\nconveniently.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/README                | 5 +++++\n t/test-lib-functions.sh | 8 ++++++++\n wrap-for-bin.sh         | 8 +++++++-\n 3 files changed, 20 insertions(+), 1 deletion(-)\n\ndiff --git a/t/README b/t/README\nindex 35438bc..1dc908e 100644\n--- a/t/README\n+++ b/t/README\n@@ -563,6 +563,11 @@ library for your script to use.\n    argument.  This is primarily meant for use during the\n    development of a new test script.\n \n+ - debug <git-command>\n+\n+   Run a git command inside a debugger. This is primarily meant for\n+   use when debugging a failing test script.\n+\n  - test_done\n \n    Your test script must have test_done at the end.  Its purpose\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 6dffb8b..73e37a1 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -145,6 +145,14 @@ test_pause () {\n \tfi\n }\n \n+# Wrap git in gdb. Adding this to a command can make it easier to\n+# understand what is going on in a failing test.\n+#\n+# Example: \"debug git checkout master\".\n+debug () {\n+\t GIT_TEST_GDB=1 \"$@\"\n+}\n+\n # Call test_commit with the arguments \"<message> [<file> [<contents> [<tag>]]]\"\n #\n # This will commit a file with the given contents and the given commit\ndiff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\nindex 701d233..db0ec6a 100644\n--- a/wrap-for-bin.sh\n+++ b/wrap-for-bin.sh\n@@ -19,4 +19,10 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n \n-exec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n+if test -n \"$GIT_TEST_GDB\"\n+then\n+\tunset GIT_TEST_GDB\n+\texec gdb --args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n+else\n+\texec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n+fi\n-- \n2.6.0.rc2.230.g3dd15c0\n"},{"id":"272564","messageId":"alpine.DEB.1.00.1510302013340.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"20151030190256.GI7881@google.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-10-30T19:14:02Z","receivedAt":"2015-10-30T19:14:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Fri, 30 Oct 2015, Jonathan Nieder wrote:\n\n> Junio C Hamano wrote:\n> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> >> On Tue, 27 Oct 2015, Junio C Hamano wrote:\n> \n> >>> It can be called GDB=1, perhaps?\n> >>\n> >> No, this is way too generic. As I only test that the environment\n> >> variable's existence, even something like GDB=/usr/opt/gdb/bin/gdb would\n> >> trigger it.\n> >>\n> >> I could be talked into GDB_GIT=1, though.\n> >\n> > As I said in another message, I have no preference myself over the\n> > name of this variable (or making it a shell function like Duy\n> > mentioned, which incidentally may give us more visual pleasantness\n> > by losing '=').\n> >\n> > I'd just be happy as long as the feature becomes available, and I'd\n> > leave the choice of consistent and convenient naming to others who\n> > have stronger opinions ;-)\n> \n> Here's a suggested patch.\n\nI am fine with this patch as a replacement for my original version.\n\nThanks,\nDscho\n"},{"id":"272566","messageId":"20151030192652.GA5336@sigill.intra.peff.net","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510301923010.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-10-30T19:26:52Z","receivedAt":"2015-10-30T19:26:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 30, 2015 at 07:25:24PM +0100, Johannes Schindelin wrote:\n\n> > I agree doing so would be crazy. But would:\n> > \n> >   ./t1234-frotz.sh --gdb=17\n> > \n> > be sane to run gdb only inside test 17?\n> \n> It would probably be sane, but I never encountered the need for something\n> like that. It was always much easier to run the test using `sh -x t... -i\n> -v` to find out what command was behaving funnily (mind you, that can be a\n> pretty hard thing todo, we have some quite convoluted test scripts in our\n> code base) and then edit the test.\n> \n> I would expect that `--gdb=<n>` thing to drive me crazy: first, I would\n> choose the wrong number. Next, I would probably forget that test_commit\n> and other commands *also* calls Git.\n\nYeah, good points. You somehow have to say \"debug _this_ git\ninvocation\", and there is probably not a more precise way to do that\nthan sticking something in the code on the right line.\n\nI do think I like Junio's \"debug git foo\" rather than setting the\nenvironment variable, as its syntactically a little simpler to type (and\nof course it would probably be implemented with an environment variable,\nso one could whichever style they prefer).\n\n-Peff\n"},{"id":"272574","messageId":"20151030195611.GC5486@sigill.intra.peff.net","threadId":"40645","inReplyTo":"20151030190256.GI7881@google.com","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-10-30T19:56:12Z","receivedAt":"2015-10-30T19:56:12Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 30, 2015 at 12:02:56PM -0700, Jonathan Nieder wrote:\n\n> > I'd just be happy as long as the feature becomes available, and I'd\n> > leave the choice of consistent and convenient naming to others who\n> > have stronger opinions ;-)\n> \n> Here's a suggested patch.\n> \n> -- >8 --\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Subject: Facilitate debugging Git executables in tests with gdb\n> \n> When prefixing a Git call in the test suite with 'debug ', it will now\n> be run with GDB, allowing the developer to debug test failures more\n> conveniently.\n\nAt the risk of repeating what I just said elsewhere in the thread, I\nthink this patch is the best of the proposed solutions.\n\n> --- a/wrap-for-bin.sh\n> +++ b/wrap-for-bin.sh\n> @@ -19,4 +19,10 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'\n>  PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n>  export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR\n>  \n> -exec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> +if test -n \"$GIT_TEST_GDB\"\n> +then\n> +\tunset GIT_TEST_GDB\n> +\texec gdb --args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> +else\n> +\texec \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> +fi\n\nSomebody suggested elsewhere that the name \"gdb\" be configurable. We\ncould stick that in the same variable, like:\n\n  test \"$GIT_TEST_GDB\" = 1 && GIT_TEST_GDB=gdb\n  exec ${GIT_TEST_GDB} --args ...\n\nbut that does not play well with the \"debug\" function, which does not\nknow which value to set it to. I guess we would need GIT_TEST_GDB_PATH\nor something.\n\nI am happy to let that get added later by interested parties (I am happy\nwith \"gdb\" myself). I just wanted to mention it to make sure we are not\npainting ourselves into any corners.\n\n-Peff\n"},{"id":"272582","messageId":"20151030213009.GJ7881@google.com","threadId":"40645","inReplyTo":"20151030195611.GC5486@sigill.intra.peff.net","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2015-10-30T21:30:09Z","receivedAt":"2015-10-30T21:30:09Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jeff King wrote:\n\n> Somebody suggested elsewhere that the name \"gdb\" be configurable. We\n> could stick that in the same variable, like:\n>\n>   test \"$GIT_TEST_GDB\" = 1 && GIT_TEST_GDB=gdb\n>   exec ${GIT_TEST_GDB} --args ...\n>\n> but that does not play well with the \"debug\" function, which does not\n> know which value to set it to. I guess we would need GIT_TEST_GDB_PATH\n> or something.\n\n*nod* I think having a separate variable like GIT_TEST_GDB_COMMAND\nwould be fine.\n\nAn interested person could also replace 'gdb --args' with 'lldb --' if\nthey want to.\n"},{"id":"272586","messageId":"xmqqio5oja4r.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"20151030195611.GC5486@sigill.intra.peff.net","subject":"Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-30T21:53:56Z","receivedAt":"2015-10-30T21:53:56Z","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> At the risk of repeating what I just said elsewhere in the thread, I\n> think this patch is the best of the proposed solutions.\n\nOK, will queue.  I agree that more could be built on top, instead of\npolishing this further in place.\n\nThanks.\n"},{"id":"272644","messageId":"6AE1604EE3EC5F4296C096518C6B77EE5D0FDABA0B@mail.accesssoftek.com","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510301941170.31610@s15462909.onlinehome-server.info","subject":"RE: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Victor Leschuk","fromEmail":"vleschuk@accesssoftek.com","sentAt":"2015-11-01T05:31:14Z","receivedAt":"2015-11-01T05:31:14Z","isPatch":true,"sender":{"key":"vleschuk@accesssoftek.com","avatar":null},"body":"\n\n> >   +if test -n \"$TEST_GDB_GIT\"\n> > +then\n> > +   exec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> Maybe we could make $TEST_GDB_GIT not just a boolean flag? It would be useful\n> to contain \"gdb\" executable name. It would allow to set path to GDB when it\n> is not in $PATH, set different debuggers (for example, I usually use cgdb),\n> or even set it to /path/to/gdb_wrapper.sh which could contain different gdb\n> options and tunings.\n\n> Sure, as long as TEST_GDB_GIT=1 still works. Why don't you make an add-on\n> patch and submit it?\n\nHello Johannes,\n\nSure, I will prepare the patch as soon as this one is included in master.\n--\nVictor\n"},{"id":"272655","messageId":"alpine.DEB.1.00.1511011436550.31610@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"6AE1604EE3EC5F4296C096518C6B77EE5D0FDABA0B@mail.accesssoftek.com","subject":"RE: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-11-01T13:37:34Z","receivedAt":"2015-11-01T13:37:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Victor,\n\nOn Sat, 31 Oct 2015, Victor Leschuk wrote:\n\n> > >   +if test -n \"$TEST_GDB_GIT\"\n> > > +then\n> > > +   exec gdb -args \"${GIT_EXEC_PATH}/@@PROG@@\" \"$@\"\n> > Maybe we could make $TEST_GDB_GIT not just a boolean flag? It would be useful\n> > to contain \"gdb\" executable name. It would allow to set path to GDB when it\n> > is not in $PATH, set different debuggers (for example, I usually use cgdb),\n> > or even set it to /path/to/gdb_wrapper.sh which could contain different gdb\n> > options and tunings.\n> \n> > Sure, as long as TEST_GDB_GIT=1 still works. Why don't you make an add-on\n> > patch and submit it?\n> \n> Sure, I will prepare the patch as soon as this one is included in master.\n\nExcuse my asking: why do you want to wait?\n\nCiao,\nJohannes\n"},{"id":"273114","messageId":"87si4e6c49.fsf@red.patthoyts.tk","threadId":"40645","inReplyTo":"alpine.DEB.1.00.1510271651420.31610@s15462909.onlinehome-server.info","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2015-11-09T22:28:54Z","receivedAt":"2015-11-09T22:28:54Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>Hi,\n>\n>On Tue, 27 Oct 2015, Johannes Schindelin wrote:\n>\n>> On Mon, 26 Oct 2015, Junio C Hamano wrote:\n>> \n>> > James McCoy <vega.james@gmail.com> writes:\n>> > \n>> > >> The code looks OK but the last paragraph makes _us_ worried.  What\n>> > >> is the licensing status of the original at SO?\n>> > >\n>> > > According to Stackoverflow[0],\n>> > >\n>> > >   As noted in the Stack Exchange Terms of Service[1] and in the footer of\n>> > >   every page, all user contributions are licensed under Creative Commons\n>> > >   Attribution-Share Alike[2]. Proper attribution[3] is required if you\n>> > >   republish any Stack Exchange content.\n>> > >\n>> > > [0]: https://stackoverflow.com/help/licensing\n>> > \n>> > Yes, and (please correct me if I am wrong--this is one of the times\n>> > I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,\n>> > in which case we cannot use this patch (instead somebody has to\n>> > reimplement the same without copying).\n>> \n>> Pat, could you please allow us to insert your SOB?\n>\n>On second thought... Junio, could you please sanity-check my claim that\n>this patch:\n>\n>-- snip --\n>@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)\n> \n>        if (curl_http_proxy) {\n>                curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);\n>+#if LIBCURL_VERSION_NUM >= 0x071800\n>+               if (starts_with(curl_http_proxy, \"socks5\"))\n>+                       curl_easy_setopt(result,\n>+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);\n>+               else if (starts_with(curl_http_proxy, \"socks4a\"))\n>+                       curl_easy_setopt(result,\n>+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);\n>+               else if (starts_with(curl_http_proxy, \"socks\"))\n>+                       curl_easy_setopt(result,\n>+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);\n>+#endif\n>        }\n> #if LIBCURL_VERSION_NUM >= 0x070a07\n>        curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n>-- snap --\n>\n>cannot be copyrighted because it is pretty much the only way to implement\n>said functionality?\n>\n>Still, Pat, if you find the time, could you please simply relicense your\n>patch (I know that you are fine with it, but we need an explicit\n>statement)?\n>\n>Ciao,\n>Johannes\n\nA bit late to the party but 'yes'. Frankly by posting something to SO I\nrather consider it public domain but I hereby license this patch as\nrequired for use by the Git project.\n\nSigned-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"273385","messageId":"alpine.DEB.1.00.1511162246540.1686@s15462909.onlinehome-server.info","threadId":"40645","inReplyTo":"87si4e6c49.fsf@red.patthoyts.tk","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-11-16T21:49:08Z","receivedAt":"2015-11-16T21:49:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Pat,\n\nOn Mon, 9 Nov 2015, Pat Thoyts wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >On Tue, 27 Oct 2015, Johannes Schindelin wrote:\n> >\n> >> On Mon, 26 Oct 2015, Junio C Hamano wrote:\n> >> \n> >> > James McCoy <vega.james@gmail.com> writes:\n> >> > \n> >> > >> The code looks OK but the last paragraph makes _us_ worried.  What\n> >> > >> is the licensing status of the original at SO?\n> >> > >\n> >> > > According to Stackoverflow[0],\n> >> > >\n> >> > >   As noted in the Stack Exchange Terms of Service[1] and in the footer of\n> >> > >   every page, all user contributions are licensed under Creative Commons\n> >> > >   Attribution-Share Alike[2]. Proper attribution[3] is required if you\n> >> > >   republish any Stack Exchange content.\n> >> > >\n> >> > > [0]: https://stackoverflow.com/help/licensing\n> >> > \n> >> > Yes, and (please correct me if I am wrong--this is one of the times\n> >> > I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,\n> >> > in which case we cannot use this patch (instead somebody has to\n> >> > reimplement the same without copying).\n> >> \n> >> Pat, could you please allow us to insert your SOB?\n> >\n> >On second thought... Junio, could you please sanity-check my claim that\n> >this patch:\n> >\n> >-- snip --\n> >@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)\n> > \n> >        if (curl_http_proxy) {\n> >                curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);\n> >+#if LIBCURL_VERSION_NUM >= 0x071800\n> >+               if (starts_with(curl_http_proxy, \"socks5\"))\n> >+                       curl_easy_setopt(result,\n> >+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);\n> >+               else if (starts_with(curl_http_proxy, \"socks4a\"))\n> >+                       curl_easy_setopt(result,\n> >+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);\n> >+               else if (starts_with(curl_http_proxy, \"socks\"))\n> >+                       curl_easy_setopt(result,\n> >+                               CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);\n> >+#endif\n> >        }\n> > #if LIBCURL_VERSION_NUM >= 0x070a07\n> >        curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n> >-- snap --\n> >\n> >cannot be copyrighted because it is pretty much the only way to implement\n> >said functionality?\n> >\n> >Still, Pat, if you find the time, could you please simply relicense your\n> >patch (I know that you are fine with it, but we need an explicit\n> >statement)?\n> >\n> >Ciao,\n> >Johannes\n> \n> A bit late to the party but 'yes'. Frankly by posting something to SO I\n> rather consider it public domain\n\nYeah, unfortunately it needs to be stated explicitly, though... ;-)\n\n> but I hereby license this patch as required for use by the Git project.\n> \n> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n\nThanks!\n\nCiao,\nDscho\n"},{"id":"273467","messageId":"xmqqa8qbol3n.fsf@gitster.mtv.corp.google.com","threadId":"40645","inReplyTo":"87si4e6c49.fsf@red.patthoyts.tk","subject":"Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-11-18T06:52:28Z","receivedAt":"2015-11-18T06:52:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pat Thoyts <patthoyts@users.sourceforge.net> writes:\n\n> A bit late to the party but 'yes'. Frankly by posting something to SO I\n> rather consider it public domain ...\n\nUnless otherwise noted, material posted on stackoverflow by default\nbecomes CC-SA-BY (which may not be the best choice for open source\nsoftware).\n\nThanks for the patch.\n"}]}