* [PATCH v13 20/20] index-helper: indexhelper.exitafter config
@ 2016-06-26 17:54 David Turner
2016-06-27 15:55 ` Duy Nguyen
0 siblings, 1 reply; 2+ messages in thread
From: David Turner @ 2016-06-26 17:54 UTC (permalink / raw)
To: git, pclouds, kamggg; +Cc: David Turner, Junio C Hamano
From: David Turner <dturner@twopensource.com>
Add a configuration variable, indexhelper.exitafter, which provides a
default time to keep the index-helper alive. This is useful with
indexhelper.autorun; some users will want to keep the
automatically-run index-helper alive across their lunch break and will
thus set indexhelper.exitafter to a high value.
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/config.txt | 4 ++++
index-helper.c | 2 ++
t/t7900-index-helper.sh | 8 ++++++++
3 files changed, 14 insertions(+)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 385ea66..336d5a2 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1860,6 +1860,10 @@ indexhelper.autorun::
Automatically run git index-helper when any builtin git
command is run inside a repository.
+indexhelper.exitafter::
+ When no exit-after argument is given, git index-helper defaults
+ to this number of seconds. Specify 0 to wait forever. Default is 600.
+
init.templateDir::
Specify the directory from which templates will be copied.
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
diff --git a/index-helper.c b/index-helper.c
index f57fc14..a8071ae 100644
--- a/index-helper.c
+++ b/index-helper.c
@@ -433,6 +433,8 @@ int main(int argc, char **argv)
git_extract_argv0_path(argv[0]);
git_setup_gettext();
+ git_config_get_int("indexhelper.exitafter", &idle_in_seconds);
+
if (argc == 2 && !strcmp(argv[1], "-h"))
usage_with_options(usage_text, options);
diff --git a/t/t7900-index-helper.sh b/t/t7900-index-helper.sh
index 3cfdf63..6c9b4dd 100755
--- a/t/t7900-index-helper.sh
+++ b/t/t7900-index-helper.sh
@@ -66,4 +66,12 @@ test_expect_success 'index-helper autorun works' '
test_path_is_missing .git/index-helper.sock
'
+test_expect_success 'indexhelper.exitafter config works' '
+ test_when_finished "git index-helper --kill" &&
+ test_config indexhelper.exitafter 1 &&
+ git index-helper --detach &&
+ sleep 3 &&
+ test_path_is_missing .git/index-helper.sock
+'
+
test_done
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v13 20/20] index-helper: indexhelper.exitafter config
2016-06-26 17:54 [PATCH v13 20/20] index-helper: indexhelper.exitafter config David Turner
@ 2016-06-27 15:55 ` Duy Nguyen
0 siblings, 0 replies; 2+ messages in thread
From: Duy Nguyen @ 2016-06-27 15:55 UTC (permalink / raw)
To: David Turner
Cc: Git Mailing List, Keith McGuigan, David Turner, Junio C Hamano
On Sun, Jun 26, 2016 at 7:54 PM, David Turner <novalis@novalis.org> wrote:
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 385ea66..336d5a2 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1860,6 +1860,10 @@ indexhelper.autorun::
> Automatically run git index-helper when any builtin git
> command is run inside a repository.
>
> +indexhelper.exitafter::
Super minor and not worth a re-roll if this is the only change. We
follow the camelCase naming convention here, so indexHelper.exitAfter
instead.
> + When no exit-after argument is given, git index-helper defaults
> + to this number of seconds. Specify 0 to wait forever. Default is 600.
> +
> init.templateDir::
> Specify the directory from which templates will be copied.
> (See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
--
Duy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-27 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-26 17:54 [PATCH v13 20/20] index-helper: indexhelper.exitafter config David Turner
2016-06-27 15:55 ` Duy Nguyen
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).