Re: [PATCH v2 0/2] improve-wincred-compatibility

2013-02-26 Thread Johannes Schindelin
Hi Karsten,

On Tue, 26 Feb 2013, Karsten Blees wrote:

 @Pat, Dscho: the rebase-merge script should automatically drop patches
 found in upstream, correct?

Yep, that's the idea. Under some circumstances, --cherry will fail to pick
up on it and the commits will still be marked for 'pick', but when it
comes to them, there will be no changes to be committed.

Ciao,
Dscho
--
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 v2 0/2] improve-wincred-compatibility

2013-02-26 Thread Erik Faye-Lund
On Tue, Feb 26, 2013 at 12:51 AM, Junio C Hamano gits...@pobox.com wrote:
 My question was if msysgit folks
 want me to take your patch (which I cannot test myself) and then
 merge my tree to the msysgit tree as part of their regular updates
 to catch up with 1.8.2 (and future releases), or they want to test
 your patches in their tree first, and then either throw me a pull
 request or send me a patch series with Acked-by:.

The following changes since commit 4dac0679feaebbf6545daec14480cf6b94cb74ed:

  Git 1.8.2-rc1 (2013-02-25 09:03:26 -0800)

are available in the git repository at:

  git://github.com/kusma/git.git for-junio

for you to fetch changes up to 8b2d219a3d6db49c8c3c0a5b620af33d6a40a974:

  wincred: improve compatibility with windows versions (2013-02-26
17:42:46 +0100)


Karsten Blees (2):
  wincred: accept CRLF on stdin to simplify console usage
  wincred: improve compatibility with windows versions

 .../credential/wincred/git-credential-wincred.c| 206 -
 1 file changed, 75 insertions(+), 131 deletions(-)
--
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 v2 0/2] improve-wincred-compatibility

2013-02-26 Thread Junio C Hamano
Thanks.
--
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 v2 0/2] improve-wincred-compatibility

2013-02-25 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes:

 Am 25.02.2013 07:43, schrieb Junio C Hamano:
 Erik Faye-Lund kusmab...@gmail.com writes:
 ...
 I'm in the marking leftover bits mode today, and noticed that
 nothing happened for this topic in my tree. Did msysgit folks expect
 me to pick this up directly, or did you guys want to feed this series
 to me (with possibly other changes you worked on outside this list)?

 The second patch changes the credential format in a
 backward-incompatible way, so I think this should be in git.git,
 too (better than having two incompatible versions around).

I am a bit confused by that comment, as it was my understanding that
the credential format only refers to what is stored in the Windows
specific credential storage and relevant only to users of msysgit
(and I expected folks who are using Git natively on Windows to be
using msysgit, not git.git), but in any case, of course we would
want a single version and format.  My question was if msysgit folks
want me to take your patch (which I cannot test myself) and then
merge my tree to the msysgit tree as part of their regular updates
to catch up with 1.8.2 (and future releases), or they want to test
your patches in their tree first, and then either throw me a pull
request or send me a patch series with Acked-by:.

I can obviously go either way, but if they expect the former (i.e. I
first apply and they pull) while I expect the latter (i.e. they
first apply and I pull), then nothing will happen, and if we go the
other way around, we would end up getting two copies of the same
series. The question was primarily to avoid these possibilities.

--
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 v2 0/2] improve-wincred-compatibility

2013-02-25 Thread Karsten Blees
Am 25.02.2013 07:43, schrieb Junio C Hamano:
 Erik Faye-Lund kusmab...@gmail.com writes:
 
 On Thu, Jan 10, 2013 at 1:10 PM, Karsten Blees karsten.bl...@gmail.com 
 wrote:
 Changes since initial version (see attached diff for details):
 - split in two patches
 - removed unused variables
 - improved the dll error message
 - changed ?: to if else
 - added comments

 Also available here:
 https://github.com/kblees/git/tree/kb/improve-wincred-compatibility-v2
 git pull git://github.com/kblees/git.git kb/improve-wincred-compatibility-v2

 Karsten Blees (2):
   wincred: accept CRLF on stdin to simplify console usage
   wincred: improve compatibility with windows versions

  .../credential/wincred/git-credential-wincred.c| 206 
 -
  1 file changed, 75 insertions(+), 131 deletions(-)


 Wonderful!

 Acked-by: Erik Faye-Lund kusmab...@gmail.com
 
 I'm in the marking leftover bits mode today, and noticed that
 nothing happened for this topic in my tree. Did msysgit folks expect
 me to pick this up directly, or did you guys want to feed this series
 to me (with possibly other changes you worked on outside this list)?
 

The second patch changes the credential format in a backward-incompatible way, 
so I think this should be in git.git, too (better than having two incompatible 
versions around).

@Pat, Dscho: the rebase-merge script should automatically drop patches found in 
upstream, correct?
--
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 v2 0/2] improve-wincred-compatibility

2013-02-24 Thread Junio C Hamano
Erik Faye-Lund kusmab...@gmail.com writes:

 On Thu, Jan 10, 2013 at 1:10 PM, Karsten Blees karsten.bl...@gmail.com 
 wrote:
 Changes since initial version (see attached diff for details):
 - split in two patches
 - removed unused variables
 - improved the dll error message
 - changed ?: to if else
 - added comments

 Also available here:
 https://github.com/kblees/git/tree/kb/improve-wincred-compatibility-v2
 git pull git://github.com/kblees/git.git kb/improve-wincred-compatibility-v2

 Karsten Blees (2):
   wincred: accept CRLF on stdin to simplify console usage
   wincred: improve compatibility with windows versions

  .../credential/wincred/git-credential-wincred.c| 206 
 -
  1 file changed, 75 insertions(+), 131 deletions(-)


 Wonderful!

 Acked-by: Erik Faye-Lund kusmab...@gmail.com

I'm in the marking leftover bits mode today, and noticed that
nothing happened for this topic in my tree. Did msysgit folks expect
me to pick this up directly, or did you guys want to feed this series
to me (with possibly other changes you worked on outside this list)?
--
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 v2 0/2] improve-wincred-compatibility

2013-01-11 Thread Erik Faye-Lund
On Thu, Jan 10, 2013 at 1:10 PM, Karsten Blees karsten.bl...@gmail.com wrote:
 Changes since initial version (see attached diff for details):
 - split in two patches
 - removed unused variables
 - improved the dll error message
 - changed ?: to if else
 - added comments

 Also available here:
 https://github.com/kblees/git/tree/kb/improve-wincred-compatibility-v2
 git pull git://github.com/kblees/git.git kb/improve-wincred-compatibility-v2

 Karsten Blees (2):
   wincred: accept CRLF on stdin to simplify console usage
   wincred: improve compatibility with windows versions

  .../credential/wincred/git-credential-wincred.c| 206 
 -
  1 file changed, 75 insertions(+), 131 deletions(-)



Wonderful!

Acked-by: Erik Faye-Lund kusmab...@gmail.com
--
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 v2 0/2] improve-wincred-compatibility

2013-01-10 Thread Karsten Blees
Changes since initial version (see attached diff for details):
- split in two patches
- removed unused variables
- improved the dll error message
- changed ?: to if else
- added comments

Also available here:
https://github.com/kblees/git/tree/kb/improve-wincred-compatibility-v2
git pull git://github.com/kblees/git.git kb/improve-wincred-compatibility-v2

Karsten Blees (2):
  wincred: accept CRLF on stdin to simplify console usage
  wincred: improve compatibility with windows versions

 .../credential/wincred/git-credential-wincred.c| 206 -
 1 file changed, 75 insertions(+), 131 deletions(-)


 git diff kb/improve-wincred-compatibility..kb/improve-wincred-compatibility-v2
diff --git a/contrib/credential/wincred/git-credential-wincred.c 
b/contrib/credential/wincred/git-credential-wincred.c
index 3464080..dac19ea 100644
--- a/contrib/credential/wincred/git-credential-wincred.c
+++ b/contrib/credential/wincred/git-credential-wincred.c
@@ -66,7 +66,7 @@ typedef BOOL (WINAPI *CredEnumerateWT)(LPCWSTR, DWORD, DWORD 
*,
 typedef VOID (WINAPI *CredFreeT)(PVOID);
 typedef BOOL (WINAPI *CredDeleteWT)(LPCWSTR, DWORD, DWORD);
 
-static HMODULE advapi, credui;
+static HMODULE advapi;
 static CredWriteWT CredWriteW;
 static CredEnumerateWT CredEnumerateW;
 static CredFreeT CredFree;
@@ -77,7 +77,7 @@ static void load_cred_funcs(void)
/* load DLLs */
advapi = LoadLibrary(advapi32.dll);
if (!advapi)
-   die(failed to load DLLs);
+   die(failed to load advapi32.dll);
 
/* get function pointers */
CredWriteW = (CredWriteWT)GetProcAddress(advapi, CredWriteW);
@@ -107,14 +107,34 @@ static void write_item(const char *what, LPCWSTR wbuf, 
int wlen)
free(buf);
 }
 
+/*
+ * Match an (optional) expected string and a delimiter in the target string,
+ * consuming the matched text by updating the target pointer.
+ */
 static int match_part(LPCWSTR *ptarget, LPCWSTR want, LPCWSTR delim)
 {
-   LPCWSTR start = *ptarget;
-   LPCWSTR end = *delim ? wcsstr(start, delim) : start + wcslen(start);
-   int len = end ? end - start : wcslen(start);
+   LPCWSTR delim_pos, start = *ptarget;
+   int len;
+
+   /* find start of delimiter (or end-of-string if delim is empty) */
+   if (*delim)
+   delim_pos = wcsstr(start, delim);
+   else
+   delim_pos = start + wcslen(start);
+
+   /*
+* match text up to delimiter, or end of string (e.g. the '/' after
+* host is optional if not followed by a path)
+*/
+   if (delim_pos)
+   len = delim_pos - start;
+   else
+   len = wcslen(start);
+
/* update ptarget if we either found a delimiter or need a match */
-   if (end || want)
-   *ptarget = end ? end + wcslen(delim) : start + len;
+   if (delim_pos || want)
+   *ptarget = delim_pos ? delim_pos + wcslen(delim) : start + len;
+
return !want || (!wcsncmp(want, start, len)  !want[len]);
 }
 
@@ -157,9 +177,6 @@ static void get_credential(void)
 static void store_credential(void)
 {
CREDENTIALW cred;
-   BYTE *auth_buf;
-   DWORD auth_buf_size = 0;
-   CREDENTIAL_ATTRIBUTEW attrs[CRED_MAX_ATTRIBUTES];
 
if (!wusername || !password)
return;

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