From: Junio C Hamano Date: Thu, 6 Jul 2023 18:54:47 +0000 (-0700) Subject: Merge branch 'tl/notes-separator' X-Git-Tag: v2.42.0-rc0~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a9cc3b8fc7c904227640aebc9b543bd9a0fb31d2;p=thirdparty%2Fgit.git Merge branch 'tl/notes-separator' 'git notes append' was taught '--separator' to specify string to insert between paragraphs. * tl/notes-separator: notes: introduce "--no-separator" option notes.c: introduce "--[no-]stripspace" option notes.c: append separator instead of insert by pos notes.c: introduce '--separator=' option t3321: add test cases about the notes stripspace behavior notes.c: use designated initializers for clarity notes.c: cleanup 'strbuf_grow' call in 'append_edit' --- a9cc3b8fc7c904227640aebc9b543bd9a0fb31d2 diff --cc builtin/notes.c index fa1b91609f,00268e949c..9f38863dd5 --- a/builtin/notes.c +++ b/builtin/notes.c @@@ -7,10 -7,10 +7,11 @@@ * and builtin/tag.c by Kristian Høgsberg and Carlos Rica. */ -#include "cache.h" -#include "alloc.h" -#include "config.h" #include "builtin.h" +#include "config.h" ++#include "alloc.h" +#include "editor.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "notes.h" @@@ -201,7 -220,8 +224,8 @@@ static void prepare_note_data(const str if (launch_editor(d->edit_path, &d->buf, NULL)) { die(_("please supply the note contents using either -m or -F option")); } - strbuf_stripspace(&d->buf, comment_line_char); + if (d->stripspace) - strbuf_stripspace(&d->buf, 1); ++ strbuf_stripspace(&d->buf, comment_line_char); } }