[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feed EOF to git user and password requester.
From: |
Tapani Tarvainen |
Subject: |
Re: Feed EOF to git user and password requester. |
Date: |
Tue, 5 Jul 2022 08:03:31 +0300 |
On Mon, Jul 04, 2022 at 11:57:24PM -0400, David Niklas (deference@null.net)
wrote:
>
> Hello,
> I have some git repos and sometimes I find that one of them ceases to
> exist. When that happens, I get a prompt for my user name and password.
>
> This causes a problem because my automatic update script hangs waiting
> for input. I tried "cat /dev/null | git pull", but git still requests the
> information and halts.
>
> Anyone have any ideas? I did search extensively online.
A couple of possibilities:
You can set GIT_ASKPASS variable to point to a script that returns the
password. I don't know how it'd work with a nonexistent repo though.
You can run the git command in the background and kill it
if it doesn't respond in a set amount of time.
If all else fails, the heavy duty industrial strength solution to this
kind of problems is Expect:
https://core.tcl-lang.org/expect/index
--
Tapani Tarvainen