Re: [PATCH 2/2] connect: improve check for plink to reduce false positives

2015-04-23 Thread Johannes Schindelin
Hi Brian, On 2015-04-24 01:14, brian m. carlson wrote: > On Thu, Apr 23, 2015 at 11:53:04AM -0400, Jeff King wrote: > >> If I were writing from scratch, I would probably keep things as tight as >> possible, like: >> >> const char *base = basename(ssh); >> plink = !strcasecmp(base, "plink") ||

Re: [PATCH 2/2] connect: improve check for plink to reduce false positives

2015-04-23 Thread Johannes Schindelin
Hi Peff, On 2015-04-23 17:53, Jeff King wrote: > What about "plink-0.83" that was mentioned earlier in the thread? I was working a lot with Java projects where the base name is often considered to be the part before a version number that is encoded into the file name, so I think it would be a

Re: [PATCH 2/2] connect: improve check for plink to reduce false positives

2015-04-23 Thread brian m. carlson
On Thu, Apr 23, 2015 at 11:53:04AM -0400, Jeff King wrote: > On Thu, Apr 23, 2015 at 08:50:17AM +0200, Johannes Schindelin wrote: > > > > + tortoiseplink = tplink == ssh || > > > + (tplink && is_dir_sep(tplink[-1])); > > > > Maybe have a hel

Re: [PATCH 2/2] connect: improve check for plink to reduce false positives

2015-04-23 Thread Jeff King
On Thu, Apr 23, 2015 at 08:50:17AM +0200, Johannes Schindelin wrote: > > + tortoiseplink = tplink == ssh || > > + (tplink && is_dir_sep(tplink[-1])); > > Maybe have a helper function here? Something like > `basename_matches(const char *p

Re: [PATCH 2/2] connect: improve check for plink to reduce false positives

2015-04-22 Thread Johannes Schindelin
Hi Brian, On 2015-04-23 02:06, brian m. carlson wrote: > + tortoiseplink = tplink == ssh || > + (tplink && is_dir_sep(tplink[-1])); Maybe have a helper function here? Something like `basename_matches(const char *path, const char *b

[PATCH 2/2] connect: improve check for plink to reduce false positives

2015-04-22 Thread brian m. carlson
The git_connect function has code to handle plink and tortoiseplink specially, as they require different command line arguments from OpenSSH. However, the match was done by checking for "plink" case-insensitively in the string, which led to false positives when GIT_SSH contained "uplink". Improve