Thread (3 messages) 3 messages, 2 authors, 2023-05-06

Re: [PATCH v9 4/6] notes.c: introduce '--separator=<paragraph-break>' option

From: Teng Long <hidden>
Date: 2023-05-06 09:22:16
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

quoted hunk ↗ jump to hunk
diff --git a/builtin/notes.c b/builtin/notes.c
index 8905298b..6eede305 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -28,7 +28,7 @@
#include "worktree.h"
#include "write-or-die.h"

-static const char *separator = "\n";
+static char *separator = "\n";
static const char * const git_notes_usage[] = {
       N_("git notes [--ref <notes-ref>] [list [<object>]]"),
       N_("git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--separator=<paragraph-break>] [-m <msg> | -F <file> | (-c | -C) <object>] [<object>]"),
@@ -248,8 +248,8 @@ static void append_separator(struct strbuf *message)
static void concat_messages(struct note_data *d)
{
       struct strbuf msg = STRBUF_INIT;
-       size_t i;

+       size_t i;
       for (i = 0; i < d->msg_nr ; i++) {
               if (d->buf.len)
                       append_separator(&d->buf);
Sorry, the direction is reversed wrongly.
diff --git a/builtin/notes.c b/builtin/notes.c
index 6eede305..8905298b 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -28,7 +28,7 @@
 #include "worktree.h"
 #include "write-or-die.h"
 
-static char *separator = "\n";
+static const char *separator = "\n";
 static const char * const git_notes_usage[] = {
        N_("git notes [--ref <notes-ref>] [list [<object>]]"),
        N_("git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--separator=<paragraph-break>] [-m <msg> | -F <file> | (-c | -C) <object>] [<object>]"),
@@ -248,8 +248,8 @@ static void append_separator(struct strbuf *message)
 static void concat_messages(struct note_data *d)
 {
        struct strbuf msg = STRBUF_INIT;
-
        size_t i;
+
        for (i = 0; i < d->msg_nr ; i++) {
                if (d->buf.len)
                        append_separator(&d->buf);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help