]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'rs/config-comment'
authorJunio C Hamano <gitster@pobox.com>
Fri, 5 Apr 2024 17:49:49 +0000 (10:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Apr 2024 17:49:49 +0000 (10:49 -0700)
"git config" learned "--comment=<message>" option to leave a
comment immediately after the "variable = value" on the same line
in the configuration file.

* rs/config-comment:
  config: allow tweaking whitespace between value and comment
  config: fix --comment formatting
  config: add --comment option to add a comment

1  2 
Documentation/git-config.txt
config.c
sequencer.c
t/t1300-config.sh

Simple merge
diff --cc config.c
Simple merge
diff --cc sequencer.c
index fa838f264f5a98f48b923b0831782a864a5ccb0f,8002b9a2ac1514c9e758ad7b1c3fff2a02e92e3e..4ae1af060a47d50924664be7462c0515c66ad95b
@@@ -3490,25 -3468,22 +3490,25 @@@ static int save_opts(struct replay_opt
                                                     opts->edit ? "true" : "false");
        if (opts->allow_empty)
                res |= git_config_set_in_file_gently(opts_file,
-                                       "options.allow-empty", "true");
+                                       "options.allow-empty", NULL, "true");
        if (opts->allow_empty_message)
                res |= git_config_set_in_file_gently(opts_file,
-                               "options.allow-empty-message", "true");
+                               "options.allow-empty-message", NULL, "true");
 +      if (opts->drop_redundant_commits)
 +              res |= git_config_set_in_file_gently(opts_file,
-                               "options.drop-redundant-commits", "true");
++                              "options.drop-redundant-commits", NULL, "true");
        if (opts->keep_redundant_commits)
                res |= git_config_set_in_file_gently(opts_file,
-                               "options.keep-redundant-commits", "true");
+                               "options.keep-redundant-commits", NULL, "true");
        if (opts->signoff)
                res |= git_config_set_in_file_gently(opts_file,
-                                       "options.signoff", "true");
+                                       "options.signoff", NULL, "true");
        if (opts->record_origin)
                res |= git_config_set_in_file_gently(opts_file,
-                                       "options.record-origin", "true");
+                                       "options.record-origin", NULL, "true");
        if (opts->allow_ff)
                res |= git_config_set_in_file_gently(opts_file,
-                                       "options.allow-ff", "true");
+                                       "options.allow-ff", NULL, "true");
        if (opts->mainline) {
                struct strbuf buf = STRBUF_INIT;
                strbuf_addf(&buf, "%d", opts->mainline);
Simple merge