From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id C43521F953 for ; Thu, 4 Nov 2021 14:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231283AbhKDO6a (ORCPT ); Thu, 4 Nov 2021 10:58:30 -0400 Received: from cloud.peff.net ([104.130.231.41]:53092 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbhKDO63 (ORCPT ); Thu, 4 Nov 2021 10:58:29 -0400 Received: (qmail 8697 invoked by uid 109); 4 Nov 2021 14:55:51 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 04 Nov 2021 14:55:51 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 3157 invoked by uid 111); 4 Nov 2021 14:55:51 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 04 Nov 2021 10:55:51 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 4 Nov 2021 10:55:50 -0400 From: Jeff King To: Steven Penny Cc: git@vger.kernel.org Subject: Re: credential-store get: No such file or directory Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Nov 04, 2021 at 09:12:39AM -0500, Steven Penny wrote: > On Thu, Nov 4, 2021 at 4:43 AM Jeff King wrote: > > It's because internally, the "git credential-store get" command is > > assembled as a single string passed to the shell, whereas remote-https > > is run directly via exec/spawn. > > Actually, I bet that is whats causing the problem. I am using MSYS2 Git [1], > which is not a native Windows build of Git, but one that relies on the MSYS2 DLL > for path translations and such. I have actually built a Windows native Git, but > its a pain, so its easier just to use the package. Anyway, the "non native" > Windows version, probably considers Bash the shell, so any commands being passed > to a shell probably will be looking for Bash. I dont have Bash on my system, > because for the most part I dont want or need it. If I need a shell, I just use > PowerShell. OK, that would explain it, I think. > Would it be possible for Git to just run "credential-store" directly, like other > commands? I assume stuff like "~/.git-credentials" would be a problem, but > couldnt you just do something like this instead (pseudocode): > > var cred string = os.Getenv("HOME") + "/.git-credentials" Possible yes, easy no. The "~" part is trivial; that's expanded inside the C program anyway. The harder thing is that helper strings can be arbitrary shell commands (if you start them with "!"), so we decide at parse time whether to stick the "git credential-" in front and then always treat it as a shell command, rather than carrying through the knowledge that it doesn't need a shell. So switching that would ripple through the whole call stack and the data structures. Definitely not impossible, and not even _hard_, but it's not like a one-liner change. -Peff