git/Documentation/config
Derrick Stolee 719399b57b credential: add new interactive config option
When scripts or background maintenance wish to perform HTTP(S) requests,
there is a risk that our stored credentials might be invalid. At the
moment, this causes the credential helper to ping the user and block the
process. Even if the credential helper does not ping the user, Git falls
back to the 'askpass' method, which includes a direct ping to the user
via the terminal.

Even setting the 'core.askPass' config as something like 'echo' will
causes Git to fallback to a terminal prompt. It uses
git_terminal_prompt(), which finds the terminal from the environment and
ignores whether stdin has been redirected. This can also block the
process awaiting input.

Create a new config option to prevent user interaction, favoring a
failure to a blocked process.

The chosen name, 'credential.interactive', is taken from the config
option used by Git Credential Manager to already avoid user
interactivity, so there is already one credential helper that integrates
with this option. However, older versions of Git Credential Manager also
accepted other string values, including 'auto', 'never', and 'always'.
The modern use is to use a boolean value, but we should still be
careful that some users could have these non-booleans. Further, we
should respect 'never' the same as 'false'. This is respected by the
implementation and test, but not mentioned in the documentation.

The implementation for the Git interactions takes place within
credential_getpass(). The method prototype is modified to return an
'int' instead of 'void'. This allows us to detect that no attempt was
made to fill the given credential, changing the single caller slightly.

Also, a new trace2 region is added around the interactive portion of the
credential request. This provides a way to measure the amount of time
spent in that region for commands that _are_ interactive. It also makes
a conventient way to test that the config option works with
'test_region'.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-20 14:44:31 -07:00
..
add.txt add-i: finally retire add.interactive.useBuiltin 2024-06-05 14:53:26 -07:00
advice.txt Merge branch 'ds/advice-sparse-index-expansion' 2024-07-16 11:18:56 -07:00
alias.txt Documentation: alias: add notes on shell expansion 2024-05-31 15:47:55 -07:00
am.txt
apply.txt documentation: whitespace is already generally plural 2023-10-09 12:06:29 -07:00
attr.txt attr.tree: HEAD:.gitattributes is no longer the default in a bare repo 2024-06-05 14:52:53 -07:00
bitmap-pseudo-merge.txt pseudo-merge: implement support for selecting pseudo-merge commits 2024-05-24 11:40:42 -07:00
blame.txt
branch.txt documentation: use clearer prepositions 2023-10-09 12:06:29 -07:00
browser.txt
bundle.txt bundle-uri: parse bundle.heuristic=creationToken 2023-01-31 08:57:48 -08:00
checkout.txt documentation: fix capitalization 2023-10-09 12:06:29 -07:00
clean.txt clean: further clean-up of implementation around "--force" 2024-03-04 14:05:13 -08:00
clone.txt doc: git-clone: do not autoreference the manpage in itself 2024-03-29 10:57:41 -07:00
color.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
column.txt documentation: fix singular vs. plural 2023-10-09 12:06:29 -07:00
commit.txt documentation: add missing article 2023-10-09 12:06:29 -07:00
commitgraph.txt commit-graph: new Bloom filter version that fixes murmur3 2024-06-25 13:52:06 -07:00
completion.txt
core.txt Merge branch 'tb/doc-max-tree-depth-fix' 2024-07-18 08:30:26 -07:00
credential.txt credential: add new interactive config option 2024-09-20 14:44:31 -07:00
diff.txt diff: let external diffs report that changes are uninteresting 2024-06-10 09:20:46 -07:00
difftool.txt mergetool: new config guiDefault supports auto-toggling gui by DISPLAY 2023-04-05 21:03:29 -07:00
extensions.txt Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
fastimport.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
feature.txt pack-objects: enable multi-pack reuse via `feature.experimental` 2024-02-05 15:27:01 -08:00
fetch.txt fetch: add new config option fetch.all 2024-01-08 13:36:23 -08:00
filter.txt
fmt-merge-msg.txt
format.txt Merge branch 'jc/doc-misspelt-refs-fix' into maint-2.43 2024-02-08 16:22:08 -08:00
fsck.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
fsmonitor--daemon.txt documentation: wording improvements 2023-10-09 12:04:21 -07:00
gc.txt Merge branch 'en/docfixes' 2023-10-23 13:56:37 -07:00
gitcvs.txt
gitweb.txt
gpg.txt documentation: fix subject/verb agreement 2023-10-09 12:06:29 -07:00
grep.txt grep docs: describe --recurse-submodules further and improve formatting a bit 2024-03-25 14:00:03 -07:00
gui.txt documentation: add missing article 2023-10-09 12:06:29 -07:00
guitool.txt
help.txt
http.txt Merge branch 'ps/doc-http-empty-cookiefile' 2024-07-17 10:47:26 -07:00
i18n.txt documentation: use clearer prepositions 2023-10-09 12:06:29 -07:00
imap.txt documentation: fix verb vs. noun 2023-10-09 12:06:29 -07:00
includeif.txt config.txt: document include, includeIf 2022-07-17 14:23:42 -07:00
index.txt documentation: fix apostrophe usage 2023-10-09 12:06:29 -07:00
init.txt doc: git-init: apply new documentation formatting guidelines 2024-03-29 10:57:40 -07:00
instaweb.txt
interactive.txt doc: interactive.singleKey is disabled by default 2024-06-07 15:27:41 -07:00
log.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
lsrefs.txt docs: move protocol-related docs to man section 5 2022-08-04 14:12:23 -07:00
mailinfo.txt documentation: fix singular vs. plural 2023-10-09 12:06:29 -07:00
mailmap.txt
maintenance.txt documentation: fix subject/verb agreement 2023-10-09 12:06:29 -07:00
man.txt documentation: add missing article 2023-10-09 12:06:29 -07:00
merge.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
mergetool.txt mergetools: vimdiff: use correct tool's name when reading mergetool config 2024-02-19 08:45:14 -08:00
notes.txt documentation: add missing article 2023-10-09 12:06:29 -07:00
pack.txt Documentation/config/pack.txt: fix broken AsciiDoc mark-up 2024-02-23 13:47:16 -08:00
pager.txt
pretty.txt
promisor.txt promisor-remote: add promisor.quiet configuration option 2024-05-26 09:17:08 -07:00
protocol.txt Sync with 2.37.4 2022-10-06 20:00:04 -04:00
pull.txt
push.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
rebase.txt Merge branch 'ms/rebase-insnformat-doc-fix' into maint-2.43 2024-02-08 16:22:12 -08:00
receive.txt builtin/receive-pack: convert to use git-maintenance(1) 2024-04-17 08:42:26 -07:00
reftable.txt refs/reftable: allow configuring geometric factor 2024-05-13 17:02:39 -07:00
remote.txt remote: allow resetting url list 2024-06-14 09:34:38 -07:00
remotes.txt
repack.txt builtin/repack.c: allow configuring cruft pack generation 2022-05-26 15:48:26 -07:00
rerere.txt documentation: fix singular vs. plural 2023-10-09 12:06:29 -07:00
revert.txt revert: config documentation fixes 2022-06-27 08:37:36 -07:00
safe.txt safe.directory: allow "lead/ing/path/*" match 2024-05-29 12:06:27 -07:00
sendemail.txt documentation: send-email: use camel case consistently 2024-02-20 14:37:44 -08:00
sequencer.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
showbranch.txt
sparse.txt
splitindex.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
ssh.txt
stash.txt documentation: add missing article 2023-10-09 12:06:29 -07:00
status.txt status: allow --untracked=false and friends 2024-03-13 10:43:32 -07:00
submodule.txt documentation: fix apostrophe usage 2023-10-09 12:06:29 -07:00
tag.txt
tar.txt
trace2.txt documentation: wording improvements 2023-10-09 12:04:21 -07:00
transfer.txt upload-pack: disallow object-info capability by default 2024-02-28 14:42:01 -08:00
uploadarchive.txt
uploadpack.txt Documentation: define protected configuration 2022-07-14 15:08:29 -07:00
url.txt
user.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
versionsort.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
web.txt
worktree.txt