git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Valentin Stanciu <svalentin@google.com>
To: git@vger.kernel.org
Subject: git config credential.helper with absolute path on windows not working properly
Date: Mon, 5 Oct 2015 16:40:21 -0400	[thread overview]
Message-ID: <CADmzSDHbH-=bX=PFqvoe23iQPF7Mq6ogV7D9c0XjdXUsORgmBQ@mail.gmail.com> (raw)

Hey guys,

I recently found that specifying absolute paths for credential helper
on windows does not work correctly if the path has spaces or non
alphanumeric characters like parentheses. From what I gather it seems
to do with how args are passed to subprocesses.

example:
git config credential.helper "C:\tmp\a (b)\git-credential-helper.cmd"

Running `git config credential.helper` shows that git got the full path:
C:\tmp\a (b)\git-credential-helper.cmd

However, when running `git push`, for example, git has problems
invoking the credential helper. If the path has no spaces or
parentheses, then everything is fine.

I tried countless ways of escaping the path, but couldn't find a
proper way to pass this to git and make it work. Tried adding more
quotes, slashes, and '^' (escape character for batch). Escaping spaces
with slashes seems to work, but couldn't find a way to escape
characters like '(' and '('.
I think git needs to add some escaping or quotes when running the
credential helper.

This affects commands that inline the credential helper too:
git clone https://path.to.repo.com C:\tmp\default --config
credential.helper="c:\tmp\a (b)\git-credential-gcloud.cmd"

Not sure if this is limited to credential helper or any config in git,
but this is a case I could repro easily.

Tested on Windows 7 x64 with all updates installed, from the command
line, using git version 2.6.0.windows.1. Git is installed to be
available from the command line.


Thanks,
Valentin

             reply	other threads:[~2015-10-05 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 20:40 Valentin Stanciu [this message]
2017-09-26 14:51 ` git config credential.helper with absolute path on windows not working properly bcampolo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADmzSDHbH-=bX=PFqvoe23iQPF7Mq6ogV7D9c0XjdXUsORgmBQ@mail.gmail.com' \
    --to=svalentin@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).