From 0ac2b43ad3eef1b52543d29c854ba895052f8074 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 28 Nov 2010 16:26:21 -0500 Subject: [PATCH] Feature #561 - Added ability to temporarily suspend GC (rc.gc:0) for a given command, which helps scriptwriters implement shadow files externally (thanks to Sander Marechal). --- AUTHORS | 1 + ChangeLog | 3 +++ NEWS | 2 ++ src/Config.cpp | 1 + src/TDB.cpp | 4 ++++ 5 files changed, 11 insertions(+) diff --git a/AUTHORS b/AUTHORS index 9277793e5..44f3fc915 100644 --- a/AUTHORS +++ b/AUTHORS @@ -66,4 +66,5 @@ suggestions: Peter De Poorter Itay Perl Max Muller + Sander Marechal diff --git a/ChangeLog b/ChangeLog index 0266d379e..ac764a472 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ 'journal.info' configuration setting. + Added 'description+' to all reports with duplicate sort keys, to stabilize the sequence. + + Added ability to temporarily suspend GC (rc.gc:0) for a given command, which + helps scriptwriters implement shadow files externally (thanks to Sander + Marechal). + Added feature #158, regular expression support for filters and substitutions. + Added feature #247, providing infinite width reports when redirecting output to a file, by setting defaultwidth to 0. diff --git a/NEWS b/NEWS index 9f89ba7c0..21a69e061 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,8 @@ New configuration options in taskwarrior 1.9.4 to 'over'). Default is off, as this is an advanced feature. - journal.info controls whether a change log for each task is displayed by the 'info' command. + - gc=off can be used, temporarily, to defer GC until later commands, which + eliminates problems with task ID numbers for script writers. Newly deprecated features in taskwarrior 1.9.4 diff --git a/src/Config.cpp b/src/Config.cpp index 7a34a930d..f23904fcd 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -60,6 +60,7 @@ std::string Config::defaults = "# Files\n" "data.location=~/.task\n" "locking=on # Use file-level locking\n" + "gc=on # Garbage-collect data files - DO NOT CHANGE unless you are sure\n" "\n" "# Terminal\n" "curses=on # Use ncurses library to determine terminal width\n" diff --git a/src/TDB.cpp b/src/TDB.cpp index 54ac1ea48..45fc77727 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -596,6 +596,10 @@ int TDB::gc () { Timer t ("TDB::gc"); + // Allowed as a temporary override. + if (!context.config.getBoolean ("gc")) + return 0; + int count_pending_changes = 0; int count_completed_changes = 0; Date now;