{"thread":{"id":"42717","subject":"[PATCH v13 20/20] index-helper: indexhelper.exitafter config","startedAt":"2016-06-26T17:54:58Z","lastAt":"2016-06-27T15:56:30Z","messageCount":2,"participants":["David Turner","Duy Nguyen"],"isPatch":true,"patchVersion":13,"patchTotal":20},"messages":[{"id":"290199","messageId":"1466963679-9947-1-git-send-email-novalis@novalis.org","threadId":"42717","inReplyTo":null,"subject":"[PATCH v13 20/20] index-helper: indexhelper.exitafter config","fromName":"David Turner","fromEmail":"novalis@novalis.org","sentAt":"2016-06-26T17:54:39Z","receivedAt":"2016-06-26T17:54:58Z","isPatch":true,"sender":{"key":"novalis@novalis.org","avatar":"https://avatars.githubusercontent.com/u/77003?v=4"},"body":"From: David Turner <dturner@twopensource.com>\n\nAdd a configuration variable, indexhelper.exitafter, which provides a\ndefault time to keep the index-helper alive.  This is useful with\nindexhelper.autorun; some users will want to keep the\nautomatically-run index-helper alive across their lunch break and will\nthus set indexhelper.exitafter to a high value.\n\nSigned-off-by: David Turner <dturner@twopensource.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/config.txt | 4 ++++\n index-helper.c           | 2 ++\n t/t7900-index-helper.sh  | 8 ++++++++\n 3 files changed, 14 insertions(+)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 385ea66..336d5a2 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1860,6 +1860,10 @@ indexhelper.autorun::\n \tAutomatically run git index-helper when any builtin git\n \tcommand is run inside a repository.\n \n+indexhelper.exitafter::\n+\tWhen no exit-after argument is given, git index-helper defaults\n+\tto this number of seconds. Specify 0 to wait forever. Default is 600.\n+\n init.templateDir::\n \tSpecify the directory from which templates will be copied.\n \t(See the \"TEMPLATE DIRECTORY\" section of linkgit:git-init[1].)\ndiff --git a/index-helper.c b/index-helper.c\nindex f57fc14..a8071ae 100644\n--- a/index-helper.c\n+++ b/index-helper.c\n@@ -433,6 +433,8 @@ int main(int argc, char **argv)\n \tgit_extract_argv0_path(argv[0]);\n \tgit_setup_gettext();\n \n+\tgit_config_get_int(\"indexhelper.exitafter\", &idle_in_seconds);\n+\n \tif (argc == 2 && !strcmp(argv[1], \"-h\"))\n \t\tusage_with_options(usage_text, options);\n \ndiff --git a/t/t7900-index-helper.sh b/t/t7900-index-helper.sh\nindex 3cfdf63..6c9b4dd 100755\n--- a/t/t7900-index-helper.sh\n+++ b/t/t7900-index-helper.sh\n@@ -66,4 +66,12 @@ test_expect_success 'index-helper autorun works' '\n \ttest_path_is_missing .git/index-helper.sock\n '\n \n+test_expect_success 'indexhelper.exitafter config works' '\n+\ttest_when_finished \"git index-helper --kill\" &&\n+\ttest_config indexhelper.exitafter 1 &&\n+\tgit index-helper --detach &&\n+\tsleep 3 &&\n+\ttest_path_is_missing .git/index-helper.sock\n+'\n+\n test_done\n-- \n1.9.1\n\n"},{"id":"290243","messageId":"CACsJy8BTtJ79L9EMJbwVCh-oqd2L-7zJKOquwoHbXkmr1hzAMw@mail.gmail.com","threadId":"42717","inReplyTo":"1466963679-9947-1-git-send-email-novalis@novalis.org","subject":"Re: [PATCH v13 20/20] index-helper: indexhelper.exitafter config","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-06-27T15:55:26Z","receivedAt":"2016-06-27T15:56:30Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, Jun 26, 2016 at 7:54 PM, David Turner <novalis@novalis.org> wrote:\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 385ea66..336d5a2 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1860,6 +1860,10 @@ indexhelper.autorun::\n>         Automatically run git index-helper when any builtin git\n>         command is run inside a repository.\n>\n> +indexhelper.exitafter::\n\nSuper minor and not worth a re-roll if this is the only change. We\nfollow the camelCase naming convention here, so indexHelper.exitAfter\ninstead.\n\n> +       When no exit-after argument is given, git index-helper defaults\n> +       to this number of seconds. Specify 0 to wait forever. Default is 600.\n> +\n>  init.templateDir::\n>         Specify the directory from which templates will be copied.\n>         (See the \"TEMPLATE DIRECTORY\" section of linkgit:git-init[1].)\n-- \nDuy\n"}]}