11

Is there an analog for SVN --non-interactive command line argument in GIT?

I am using GIT via gitpython library and have a problem in some places - program freezes. In this case GIT is trying to ask something from the user, but it can't do it. I want to disallow the attempts.

Here is process in freeze:

$ pstree -ap 14712
python,14712 src/auto-release
└─git,14720 pull --strategy=recursive -Xtheirs -v origin +master:origin/master
    └─git-merge,14721 -s recursive -Xtheirs -v Merge branch 'master' of 172.17.2.22:~/test-repo HEAD 920e34cb7267f702b7a1bb3af93619175cb566f0
phobie
  • 2,514
  • 1
  • 20
  • 21
Dmitry Bogun
  • 164
  • 1
  • 2
  • 6
  • It looks like you want to create a wrapper around git; look at [which language has the best git api bindings](http://stackoverflow.com/questions/4034962/which-language-has-the-best-git-api-bindings) – Henk Langeveld Nov 24 '12 at 18:36
  • And on the other hand, while it's clear that you want some automation, it's not clear why you want it, and why you're using git for this. Apparently, you've asked git to do something that triggered a merge and my guess is you've not told it how to handle conflicts. – Henk Langeveld Nov 24 '12 at 20:46
  • Is arguments "-s recursive -Xtheirs" to pull command not tell git to use "theirs" chunks to merge is case of conflicts? If not - point me to manual where I can know how to tell a method to handle conflicts. – Dmitry Bogun Nov 26 '12 at 09:11
  • I would be interested in this. I need an Amazon AMI to `pull` the latest from a git repo but need it to not hang if the ssh file is not there. – Matt Clarkson Feb 05 '13 at 14:05
  • 4
    I needed this. I was searching for "preventing git prompting" or "stopping git prompt" and failed to find it. – Danny Staple Apr 16 '13 at 10:33

2 Answers2

6

Git does not ask questions when it's stdin and stdout is not connected to terminal (isatty() returns false), it usually ends with an error instead.

Josef Kufner
  • 2,851
  • 22
  • 28
1

You can use the environment variable

GIT_TERMINAL_PROMPT

If this environment variable is set to 0, git will not prompt on the terminal (e.g., when asking for HTTP authentication).

Sjoerd
  • 74,049
  • 16
  • 131
  • 175