{"thread":{"id":"63582","subject":"Clarification on GPG preference update prompts during Git test suite execution","startedAt":"2025-06-04T09:39:09Z","lastAt":"2025-06-04T16:20:31Z","messageCount":3,"participants":["Haritha D","Chris Torek","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"519646","messageId":"3B3EF793-F2B0-4D77-98D7-900E5273D498@ibm.com","threadId":"63582","inReplyTo":null,"subject":"Clarification on GPG preference update prompts during Git test suite execution","fromName":"Haritha D","fromEmail":"harithamma.d@ibm.com","sentAt":"2025-06-04T09:39:06Z","receivedAt":"2025-06-04T09:39:09Z","isPatch":false,"sender":{"key":"harithamma.d@ibm.com","avatar":"https://avatars.githubusercontent.com/u/112700353?v=4"},"body":"Hi Team,\n\nI wanted help regarding the below scenario:\n\nWhile running the test suite for the latest Git version, I observed that some test cases—particularly t5573-pull-verify-signatures.sh—prompt for input with the message:\n\nReally update the preferences? (y/N)\n\nI attempted to work around this by piping yes n, but the prompt still appears, causing the tests to wait for user input.\n\nI noticed that the ci/run-build-and-tests.sh script in the Git repo does not seem to explicitly handle this scenario (e.g., no --batch, --yes, or other flags related to GPG). I’m curious—how does Git's CI/CD pipeline avoid or suppress these GPG interactive prompts during test execution?\n\nAny insights on how this is managed or best practices to handle such cases in automated environments would be greatly appreciated.\n\nThanks & regards\nHaritha\n\n\n"},{"id":"519654","messageId":"CAPx1Gvd9pUbfyq_AuQmqTqNY=mB+=agoreKR5DfphNNgc8md6A@mail.gmail.com","threadId":"63582","inReplyTo":"3B3EF793-F2B0-4D77-98D7-900E5273D498@ibm.com","subject":"Re: Clarification on GPG preference update prompts during Git test suite execution","fromName":"Chris Torek","fromEmail":"chris.torek@gmail.com","sentAt":"2025-06-04T11:13:58Z","receivedAt":"2025-06-04T11:14:12Z","isPatch":false,"sender":{"key":"chris.torek@gmail.com","avatar":"https://avatars.githubusercontent.com/u/16826774?v=4"},"body":"On Wed, Jun 4, 2025 at 2:39 AM Haritha D <Harithamma.D@ibm.com> wrote:\n> I noticed that the ci/run-build-and-tests.sh script in the Git repo does not seem to explicitly handle this scenario (e.g., no --batch, --yes, or other flags related to GPG). I’m curious—how does Git's CI/CD pipeline avoid or suppress these GPG interactive prompts during test execution?\n\nGPG does not go through Git. GPG uses the \"grab hold of the user who's\nwatching this and ask a question\" interface provided by the operating\nsystem. CI systems disable this interface (or do their best to attempt\nto do so) since there is no user watching.\n\nSince Git is not involved here, Git has no control over this. You need\nto deal with this at the GPG level (or use the same tricks that CI\nsystems use, but those are considerably more complex, and\nOS-dependent).\n\nChris\n"},{"id":"519680","messageId":"xmqqtt4vbhrn.fsf@gitster.g","threadId":"63582","inReplyTo":"CAPx1Gvd9pUbfyq_AuQmqTqNY=mB+=agoreKR5DfphNNgc8md6A@mail.gmail.com","subject":"Re: Clarification on GPG preference update prompts during Git test suite execution","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-06-04T16:20:28Z","receivedAt":"2025-06-04T16:20:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Chris Torek <chris.torek@gmail.com> writes:\n\n> On Wed, Jun 4, 2025 at 2:39 AM Haritha D <Harithamma.D@ibm.com> wrote:\n>> I noticed that the ci/run-build-and-tests.sh script in the Git repo does not seem to explicitly handle this scenario (e.g., no --batch, --yes, or other flags related to GPG). I’m curious—how does Git's CI/CD pipeline avoid or suppress these GPG interactive prompts during test execution?\n>\n> GPG does not go through Git. GPG uses the \"grab hold of the user who's\n> watching this and ask a question\" interface provided by the operating\n> system. CI systems disable this interface (or do their best to attempt\n> to do so) since there is no user watching.\n>\n> Since Git is not involved here, Git has no control over this. You need\n> to deal with this at the GPG level (or use the same tricks that CI\n> systems use, but those are considerably more complex, and\n> OS-dependent).\n\nWe do redirect our stdin to read from /dev/null but that is the\nextent we attempt to go non-interactive while running the tests,\nwhich, as you said, is insufficient to defeat applications opening\nup /dev/tty or going GUI.\n\n\n"}]}