[PATCH] send-email: Much readable error output

2014-12-26 Thread Alexander Kuleshov
Signed-off-by: 0xAX kuleshovm...@gmail.com
---
 git-send-email.perl | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 82c6fea..6a995c4 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1274,11 +1274,11 @@ X-Mailer: git-send-email $gitversion
}
 
if (!$smtp) {
-   die Unable to initialize SMTP properly. Check config 
and use --smtp-debug. ,
-   VALUES: server=$smtp_server ,
-   encryption=$smtp_encryption ,
-   hello=$smtp_domain,
-   defined $smtp_server_port ?  
port=$smtp_server_port : ;
+   die Unable to initialize SMTP properly. Check config 
and use --smtp-debug.\n,
+   VALUES: server=$smtp_server\n\t,
+   encryption=$smtp_encryption\n\t,
+   hello=$smtp_domain\n\t,
+   defined $smtp_server_port ? 
port=$smtp_server_port\n : \n;
}
 
smtp_auth_maybe or die $smtp-message;
-- 
2.2.1.202.g98acd41

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/5] Fix the Visual Studio 2008 .sln generator

2014-12-26 Thread Philip Oakley

From: Philip Oakley philipoak...@iee.org

Potential Windows developers are likely to be using Visual Studio as
their IDE. The tool stack required for Windows can be tortuous as it
crosses the boundaries between platforms and philosophies. This patch
series seeks to maintain the tools that could assist such developers.
In particular, those tools that generate an initial Visual Studio
project (.sln ) file.

The .sln generator in contrib began to break when internationalisation
introduced an extra -o option. This recently worsened with the 
addition

of invalidcontinue.obj for 'improved POSIX compatibility'.

I hacked a bit when I first attempted to use the VS IDE and noticed 
the

i18n issue. I didn't completely solve all my issues because of further
issues with VS2010 Express, so no patches were submitted at the time.

Now, with a fresh copy of VS20008 Express, I saw the additional 
problem

of the addition of the invalidcontinue.obj reference causing the .sln
generation to fail.

The series has been tested against both recent git/git and 
msysgit/git.

Both produce good VS2008 .sln project files though only msysgit/git
compiles without error, both using the msysgit msvc-build script.
Those compile errors are not related to this patch series.


Now, having tried using the VS project output for some follow on work, 
I've found that the resultant .sln file is incomplete, though does 
compile fine as noted.


Investigation has shown that the 'failure' to provide a complete Git 
project would apper to have begun somewhere between v1.7.9 and v1.8.0. 
V1.7.9 has 'git', while v1.8.0 doesn't (along with other missing 
artefacts).


Looks like firther fixes are needed once the cause is determined.



An initial RFC version was discussed on the msysgit list
https://groups.google.com/forum/#!topic/msysgit/3MQ_NMNM390 or
http://thread.gmane.org/gmane.comp.version-control.msysgit/21132.

The final patch adds a poorman's --verbose by a few carefully selected
commented out debug print statements to assist others in resolving
future breakages.

I've cc'd those who have contributed or patched the engine.pl, or
appear to be interested via a $gmane search, who can hopefully 
comment.



Philip Oakley (5):
 engine.pl: Fix i18n -o option in msvc buildsystem generator
 engine.pl: Properly accept quoted spaces in filenames
 engine.pl: ignore invalidcontinue.obj which is known to MSVC
 vcbuild/readme: Improve layout and reference msvc-build script
 engine.pl: provide more debug print statements

compat/vcbuild/README  | 27 +++
contrib/buildsystems/engine.pl | 27 +--
2 files changed, 40 insertions(+), 14 deletions(-)

--


Philip 


--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] engine.pl: Fix i18n -o option in msvc buildsystem generator

2014-12-26 Thread Philip Oakley

From: Philip Oakley philipoak...@iee.org

The i18n 5e9637c (i18n: add infrastructure for translating
Git with gettext, 2011-11-18) introduced an extra '-o' option
into the make file, which broke engine.pl code for extracting
the git.sln for msvc gui-IDE.

Add tests to remove these non linker options, in same vein as
74cf9bd (engine.pl: Fix a recent breakage of the buildsystem
generator, 2010-01-22).


It now looks like this resolution is in the wrong direction. The
correct right solution is to include
   NO_GETTEXT = YesPlease
into the _Windows_ section of the Makefile.

Mysgit uses the _MinGW_ section, and fixed the NO_GETTEXT requirement, 
so the breakage in the Windows section build wasn't noticed.


However, the test is still useful for adding a detection step and 
providing a warning to users

   NO_GETTEXT = YesPlease



Signed-off-by: Philip Oakley philipoak...@iee.org
---
contrib/buildsystems/engine.pl | 6 ++
1 file changed, 6 insertions(+)

diff --git a/contrib/buildsystems/engine.pl 
b/contrib/buildsystems/engine.pl

index 23da787..f48c28a 100755
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -140,6 +140,12 @@ sub parseMakeOutput
next;
}

+if ($text =~ /^(mkdir|msgfmt) /) {
+# options to the Portable Object translations
+# the line mkdir ...  msgfmt ... contains no linker 
options

+next;
+}
+
if($text =~ / -c /) {
# compilation
handleCompileLine($text, $line);
--


There are still more issues to be resolved e.g.
 test-svn-fe.obj : error LNK2001: unresolved external symbol _strtoull
etc.
Philip 


--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] Fix issue with format-patch and diff.submodule

2014-12-26 Thread Doug Kelly
A colleague found an issue that when using diff.submodule=log in his
.gitconfig, format-patch would use the log format for submodule changes,
which would be ignored or error out when processed by git-am.
format-patch now ignores the diff.submodule option and a testcase for
this specific issue now exists.

Since this seems like a bug in current versions, I have based and
tested this on the maint branch, but there's no reason it shouldn't
apply cleanly to master as well.

Apologies for any rawness to the first round of this change.
Long time listener; first time caller. Any feedback is appreciated.

Doug Kelly (2):
  t4255: test am submodule with diff.submodule
  format-patch: ignore diff.submodule setting

 builtin/log.c   |  2 +-
 t/t4255-am-submodule.sh | 83 +
 2 files changed, 84 insertions(+), 1 deletion(-)

-- 
2.0.5

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] format-patch: ignore diff.submodule setting

2014-12-26 Thread Doug Kelly
diff.submodule when set to log produces output which git-am cannot
handle. Ignore this setting when generating patch output.

Signed-off-by: Doug Kelly dougk@gmail.com
---
 builtin/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/log.c b/builtin/log.c
index 734aab3..cb14db4 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -705,7 +705,7 @@ static int git_format_config(const char *var, const char 
*value, void *cb)
return 0;
}
if (!strcmp(var, diff.color) || !strcmp(var, color.diff) ||
-   !strcmp(var, color.ui)) {
+   !strcmp(var, color.ui) || !strcmp(var, diff.submodule)) {
return 0;
}
if (!strcmp(var, format.numbered)) {
-- 
2.0.5

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] t4255: test am submodule with diff.submodule

2014-12-26 Thread Doug Kelly
git am will break when using diff.submodule=log; add some test cases
to illustrate this breakage as simply as possible.  There are
currently two ways this can fail:

* With errors (unrecognized input), if only change
* Silently (no submodule change), if other files change

Test for both conditions and ensure without diff.submodule this works.

Signed-off-by: Doug Kelly dougk@gmail.com
---
 t/t4255-am-submodule.sh | 83 +
 1 file changed, 83 insertions(+)

diff --git a/t/t4255-am-submodule.sh b/t/t4255-am-submodule.sh
index 8bde7db..d9a1d79 100755
--- a/t/t4255-am-submodule.sh
+++ b/t/t4255-am-submodule.sh
@@ -18,4 +18,87 @@ am_3way () {
 KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
 test_submodule_switch am_3way
 
+test_expect_success 'setup diff.submodule' '
+   echo one one 
+   git add one 
+   test_tick 
+   git commit -m initial 
+   git rev-parse HEAD initial 
+
+   git init submodule 
+   (cd submodule 
+   echo two two 
+   git add two 
+   test_tick 
+   git commit -m initial submodule 
+   git rev-parse HEAD ../initial-submodule) 
+   git submodule add ./submodule 
+   test_tick 
+   git commit -m first 
+   git rev-parse HEAD first 
+
+   (cd submodule 
+   echo three three 
+   git add three 
+   test_tick 
+   git commit -m first submodule 
+   git rev-parse HEAD ../first-submodule) 
+   git add submodule 
+   test_tick 
+   git commit -m second 
+   git rev-parse HEAD second 
+
+   (cd submodule 
+   git mv two four 
+   test_tick 
+   git commit -m second submodule 
+   git rev-parse HEAD ../second-submodule) 
+   git add submodule 
+   echo four four 
+   git add four 
+   test_tick 
+   git commit -m third 
+   git rev-parse HEAD third 
+   git submodule update --init
+'
+
+INITIAL=$(cat initial)
+SECOND=$(cat second)
+THIRD=$(cat third)
+
+run_test() {
+   START_COMMIT=$1
+   EXPECT=$2
+   (git am --abort || true) 
+   git reset --hard $START_COMMIT 
+   rm -f *.patch 
+   git format-patch -1 
+   git reset --hard $START_COMMIT^ 
+   git submodule update 
+   git am *.patch 
+   git submodule update 
+   (cd submodule  git rev-parse HEAD ../actual) 
+   test_cmp $EXPECT actual
+}
+
+test_expect_success 'diff.submodule unset' '
+   (git config --unset diff.submodule || true) 
+   run_test $SECOND 'first-submodule'
+'
+
+test_expect_success 'diff.submodule unset with extra file' '
+   (git config --unset diff.submodule || true) 
+   run_test $THIRD 'second-submodule'
+'
+
+test_expect_success 'diff.submodule=log' '
+   git config diff.submodule log 
+   run_test $SECOND 'first-submodule'
+'
+
+test_expect_success 'diff.submodule=log with extra file' '
+   git config diff.submodule log 
+   run_test $THIRD 'second-submodule'
+'
+
 test_done
-- 
2.0.5

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] send-email: Much readable error output

2014-12-26 Thread Thomas Gummerer
Hi,

Alexander Kuleshov kuleshovm...@gmail.com writes:

 Signed-off-by: 0xAX kuleshovm...@gmail.com

Please use your full name for the sign-off.

 ---
  git-send-email.perl | 10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

 diff --git a/git-send-email.perl b/git-send-email.perl
 index 82c6fea..6a995c4 100755
 --- a/git-send-email.perl
 +++ b/git-send-email.perl
 @@ -1274,11 +1274,11 @@ X-Mailer: git-send-email $gitversion
   }

   if (!$smtp) {
 - die Unable to initialize SMTP properly. Check config 
 and use --smtp-debug. ,
 - VALUES: server=$smtp_server ,
 - encryption=$smtp_encryption ,
 - hello=$smtp_domain,
 - defined $smtp_server_port ?  
 port=$smtp_server_port : ;
 + die Unable to initialize SMTP properly. Check config 
 and use --smtp-debug.\n,
 + VALUES: server=$smtp_server\n\t,
 + encryption=$smtp_encryption\n\t,
 + hello=$smtp_domain\n\t,
 + defined $smtp_server_port ? 
 port=$smtp_server_port\n : \n;

Minor nits:
  - I think this would be easier to read if the \t was on the line which
should be indented.
  - If $smtp_server_port is not defined we produce an unnecessary empty line

   }

   smtp_auth_maybe or die $smtp-message;
 --
 2.2.1.202.g98acd41

 --
 To unsubscribe from this list: send the line unsubscribe git in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] remote-curl: fall back to Basic auth if Negotiate fails.

2014-12-26 Thread brian m. carlson
Apache servers using mod_auth_kerb can be configured to allow the user
to authenticate either using Negotiate (using the Kerberos ticket) or
Basic authentication (using the Kerberos password).  Often, one will
want to use Negotiate authentication if it is available, but fall back
to Basic authentication if the ticket is missing or expired.

Teach the HTTP client code to stop trying authentication mechanisms that
don't use a password (currently Negotiate) after the first failure,
since if they failed the first time, they will never succeed.

Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
I was able to reproduce the problem on my server.  This fixes the
problem for me both when info/refs requires authentication and when it
does not.  Dan, please try and see if this fixes the problem for you.

I'm not clear on whether NTLM is a passwordless authentication method.
Since I don't use Windows or NTLM, I can't test it, but if it is, just
adding it to HTTP_AUTH_PASSWORDLESS should be sufficient.

 http.c| 14 ++
 http.h|  5 -
 remote-curl.c | 13 -
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/http.c b/http.c
index 040f362..e3e4c65 100644
--- a/http.c
+++ b/http.c
@@ -986,6 +986,16 @@ static void extract_content_type(struct strbuf *raw, 
struct strbuf *type,
strbuf_addstr(charset, ISO-8859-1);
 }
 
+void disable_passwordless_auth(struct active_request_slot *slot)
+{
+#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
+#define HTTP_AUTH_PASSWORDLESS (CURLAUTH_GSSNEGOTIATE)
+   curl_easy_setopt(slot-curl, CURLOPT_HTTPAUTH,
+CURLAUTH_ANY  ~HTTP_AUTH_PASSWORDLESS);
+#endif
+}
+
+
 /* http_request() targets */
 #define HTTP_REQUEST_STRBUF0
 #define HTTP_REQUEST_FILE  1
@@ -1035,6 +1045,9 @@ static int http_request(const char *url,
curl_easy_setopt(slot-curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(slot-curl, CURLOPT_ENCODING, gzip);
 
+   if (options-no_passwordless_auth)
+   disable_passwordless_auth(slot);
+
ret = run_one_slot(slot, results);
 
if (options  options-content_type) {
@@ -1139,6 +1152,7 @@ static int http_request_reauth(const char *url,
}
 
credential_fill(http_auth);
+   options-no_passwordless_auth = 1;
 
return http_request(url, result, target, options);
 }
diff --git a/http.h b/http.h
index 473179b..fc42bf5 100644
--- a/http.h
+++ b/http.h
@@ -98,6 +98,8 @@ extern int handle_curl_result(struct slot_results *results);
 int run_one_slot(struct active_request_slot *slot,
 struct slot_results *results);
 
+void disable_passwordless_auth(struct active_request_slot *slot);
+
 #ifdef USE_CURL_MULTI
 extern void fill_active_slots(void);
 extern void add_fill_function(void *data, int (*fill)(void *));
@@ -138,7 +140,8 @@ extern char *get_remote_object_url(const char *url, const 
char *hex,
 /* Options for http_get_*() */
 struct http_get_options {
unsigned no_cache:1,
-keep_error:1;
+keep_error:1,
+no_passwordless_auth:1;
 
/* If non-NULL, returns the content-type of the response. */
struct strbuf *content_type;
diff --git a/remote-curl.c b/remote-curl.c
index dd63bc2..89bf4ea 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -369,6 +369,8 @@ struct rpc_state {
struct strbuf result;
unsigned gzip_request : 1;
unsigned initial_buffer : 1;
+   /* Automatic authentication didn't work, so don't try it again. */
+   unsigned no_passwordless_auth : 1;
 };
 
 static size_t rpc_out(void *ptr, size_t eltsize,
@@ -467,6 +469,9 @@ static int probe_rpc(struct rpc_state *rpc, struct 
slot_results *results)
curl_easy_setopt(slot-curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
curl_easy_setopt(slot-curl, CURLOPT_FILE, buf);
 
+   if (rpc-no_passwordless_auth)
+   disable_passwordless_auth(slot);
+
err = run_slot(slot, results);
 
curl_slist_free_all(headers);
@@ -510,8 +515,10 @@ static int post_rpc(struct rpc_state *rpc)
 
do {
err = probe_rpc(rpc, results);
-   if (err == HTTP_REAUTH)
+   if (err == HTTP_REAUTH) {
credential_fill(http_auth);
+   rpc-no_passwordless_auth = 1;
+   }
} while (err == HTTP_REAUTH);
if (err != HTTP_OK)
return -1;
@@ -533,6 +540,9 @@ retry:
curl_easy_setopt(slot-curl, CURLOPT_URL, rpc-service_url);
curl_easy_setopt(slot-curl, CURLOPT_ENCODING, gzip);
 
+   if (rpc-no_passwordless_auth)
+   disable_passwordless_auth(slot);
+
if (large_request) {
/* The request body is large and the size cannot be predicted.
 * We must use chunked encoding to send it.
@@