From 7141f01264315f2af95727e28099b17e60dd1491 Mon Sep 17 00:00:00 2001 From: Bastiaan Stougie Date: Sat, 4 Apr 2026 11:16:08 -0400 Subject: [PATCH] uci: preserve, add and get comments This pull request implements preservation of comments in configuration files. Comment lines before an entry, and the comment at the end of an entry are considered to be associated with that entry. Example: # this comment line is associated with section # this comment line is associated with section config type 'section' # this comment is associated with section # this comment line is associated with opt # this comment line is associated with opt option opt 'val' # this comment is associated with opt # this comment line is not associated with any entry Wih option -D, uci works as before and strips comments. The following commands have enhanced behaviour: * uci import preserves comments of unchanged configuration entries, and imports entries with their associated comments * uci export exports entries with their associated comments * uci commit preserves comments of unchanged configuration entries when committing changes with uci commands 'add', 'delete', 'set', 'add_list', and/or 'del_list'. * uci get '.
' '#' shows the section comment * uci get '.
.