lib/config: Rename change-update-summary to auto-...
authorJonathan Lebon <jonathan@jlebon.com>
Mon, 30 Jul 2018 14:46:58 +0000 (10:46 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 1 Aug 2018 19:59:07 +0000 (19:59 +0000)
Mildly bikeshed, though I find the name `auto-update-summary` to be
easier to grok than `change-update-summary`. I think it's because it can
be read as "verb-verb-noun" rather than "noun-verb-noun".

Closes: #1693
Approved by: mwleeds

man/ostree.repo-config.xml
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo.c
src/ostree/ot-builtin-commit.c
tests/test-auto-summary.sh

index 6149248fd449a046751ad404de107d2711675e81..5424467cbcd03d4698216ef3428a0d79855ec4e2 100644 (file)
@@ -94,7 +94,7 @@ Boston, MA 02111-1307, USA.
       </varlistentry>
 
       <varlistentry>
-        <term><varname>change-update-summary</varname></term>
+        <term><varname>auto-update-summary</varname></term>
         <listitem><para>Boolean value controlling whether or not to
         automatically update the summary file after any ref is added,
         removed, or updated. This covers a superset of the cases covered by
index 12ee688821a77ea44ec5e140df09752b9523de46..dd225e63c568970ff8325a6da83b4d2b5cc558d9 100644 (file)
@@ -2202,7 +2202,7 @@ ostree_repo_commit_transaction (OstreeRepo                  *self,
       return FALSE;
   g_clear_pointer (&self->txn.collection_refs, g_hash_table_destroy);
 
-  /* Update the summary if change-update-summary is set, because doing so was
+  /* Update the summary if auto-update-summary is set, because doing so was
    * delayed for each ref change during the transaction.
    */
   if (!_ostree_repo_maybe_regenerate_summary (self, cancellable, error))
index 10f87dba80550cbd9b77f02aa4bc488541191f1c..00a6b460b932f873bfb9d405024e950f5ba7133e 100644 (file)
@@ -5387,7 +5387,7 @@ summary_add_ref_entry (OstreeRepo       *self,
  *
  * It is regenerated automatically after a commit if
  * `core/commit-update-summary` is set, and automatically after any ref is
- * added, removed, or updated if `core/change-update-summary` is set.
+ * added, removed, or updated if `core/auto-update-summary` is set.
  *
  * If the `core/collection-id` key is set in the configuration, it will be
  * included as %OSTREE_SUMMARY_COLLECTION_ID in the summary file. Refs that
@@ -5593,23 +5593,21 @@ ostree_repo_regenerate_summary (OstreeRepo     *self,
   return TRUE;
 }
 
-/* Regenerate the summary if `core/change-update-summary` is set */
+/* Regenerate the summary if `core/auto-update-summary` is set */
 gboolean
 _ostree_repo_maybe_regenerate_summary (OstreeRepo    *self,
                                        GCancellable  *cancellable,
                                        GError       **error)
 {
-  gboolean update_summary;
+  gboolean auto_update_summary;
 
   if (!ot_keyfile_get_boolean_with_default (self->config, "core",
-                                            "change-update-summary", FALSE,
-                                            &update_summary, error))
+                                            "auto-update-summary", FALSE,
+                                            &auto_update_summary, error))
     return FALSE;
 
-  if (update_summary && !ostree_repo_regenerate_summary (self,
-                                                         NULL,
-                                                         cancellable,
-                                                         error))
+  if (auto_update_summary &&
+      !ostree_repo_regenerate_summary (self, NULL, cancellable, error))
     return FALSE;
 
   return TRUE;
index ded6522fc5fbe84989b800cf7def073d2aa580e2..6d295d6b4e363a8c192fbd41dd2dc9303426115f 100644 (file)
@@ -753,7 +753,7 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio
   if (!skip_commit)
     {
       guint64 timestamp;
-      gboolean change_update_summary;
+      gboolean auto_update_summary;
 
       if (!opt_no_bindings)
         {
@@ -825,12 +825,12 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio
         goto out;
 
       if (!ot_keyfile_get_boolean_with_default (ostree_repo_get_config (repo), "core",
-                                                "change-update-summary", FALSE,
-                                                &change_update_summary, error))
+                                                "auto-update-summary", FALSE,
+                                                &auto_update_summary, error))
         goto out;
 
       /* No need to update it again if we did for each ref change */
-      if (opt_orphan || !change_update_summary)
+      if (opt_orphan || !auto_update_summary)
         {
           gboolean commit_update_summary;
 
index 5811fcdec7bf8a1446fa4a523c374cabb6a91eb0..3a04f18479b51f30a3f724494da86ba8f779eec3 100755 (executable)
@@ -65,7 +65,7 @@ touch repo/summary.sig
 $OSTREE summary --update
 assert_not_has_file repo/summary.sig
 
-# Check that without change-update-summary set, adding, changing, or deleting a ref doesn't update the summary
+# Check that without auto-update-summary set, adding, changing, or deleting a ref doesn't update the summary
 $OSTREE summary --update
 OLD_MD5=$(md5sum repo/summary)
 $OSTREE commit -b test2 -s "A commit" test
@@ -80,8 +80,8 @@ $OSTREE refs --delete test
 
 assert_streq "$OLD_MD5" "$(md5sum repo/summary)"
 
-# Check that with change-update-summary set, adding, changing, or deleting a ref updates the summary
-$OSTREE --repo=repo config set core.change-update-summary true
+# Check that with auto-update-summary set, adding, changing, or deleting a ref updates the summary
+$OSTREE --repo=repo config set core.auto-update-summary true
 
 $OSTREE summary --update
 OLD_MD5=$(md5sum repo/summary)