From patchwork Mon Nov 7 13:57:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teng Long X-Patchwork-Id: 13034375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DC32C433FE for ; Mon, 7 Nov 2022 13:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231697AbiKGN5R (ORCPT ); Mon, 7 Nov 2022 08:57:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231563AbiKGN5P (ORCPT ); Mon, 7 Nov 2022 08:57:15 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 040C61CFF7 for ; Mon, 7 Nov 2022 05:57:15 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id v17so11145463plo.1 for ; Mon, 07 Nov 2022 05:57:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a+1dfx8UTfsUc7TbPw1xnjTIwxKJGjT+6amGUQB2GQw=; b=nzxoeWpUZKu0HMeQpf/i1BkDjcoQv83a5A9eFNymQUQ6myO6Epg6dNDY21rrb4Ly4W 9ASpI9Cyo7kkQbNxJinjobtUUItTfxet0KomD9SQapUYi3YPkknGgWVnGOM7C11/Iayl 5sKE6QOdqhUvXYYRktihOpb/7gbHNTlxWHXPx948pJbWt7vBuOKfnoVjaGCJhl2bi1zy FSRL1uQT0OWvRmt/IyWIai7WbWDpN9X/deonHvhh/WEfcCDQrMq7NHqW0xO0uAR3Vy3T v/snt1pq65No25KSLnGDD0VRpEbA0rInx1yU3iXY8+h8jZafB1Uumt6vMZIpWVvUeb7u YQTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a+1dfx8UTfsUc7TbPw1xnjTIwxKJGjT+6amGUQB2GQw=; b=rYHdnl+Q+n8ofo/xGMqN17tYI6tEYPABa6ik8ls4JROYTRU4VnkXKg2pwOGM+l7ip9 WH16dOSQquGB8GThhJuS3VU6btkTnOc+hHLBEVLNVEzBlDMweYDzWkSBydydIYnjXejB xIi+uYTSZJx13AVHxLCBK8yTCZbqGGzU/mYTz6n+/tBlSKuQsDQQVwWPLYMU0/xQ/Ksh XYYOB07cXPSz2+Jdgr8B4FqDkLOcQzh11c5oclUkhdCIDC0c3qK/KoFiZOYhvjtGzQzH vYWagsb5oGWpT7rg8nfxJDrbnFlHBUOEHsDJ1QmWs5wSCWV9vpjMux4GM4jo2YlIAslr YCfA== X-Gm-Message-State: ACrzQf0DMfW8rG/mzneRDlaQlvddoMLKsNTwCS1yC7jhg5NShFa6PNbY qdA6UtW+2H5jFQXFtLsJlrw+Br5B4DLqn1yG X-Google-Smtp-Source: AMsMyM4LEAkJ9wRuRkUUwiXcScEpgA+Ul6/pH0b2Iz/lnFFcLDbAZblrnynXSkEnt1oYgeMxoFy/Hw== X-Received: by 2002:a17:902:b28c:b0:186:708e:6ed7 with SMTP id u12-20020a170902b28c00b00186708e6ed7mr50197482plr.98.1667829434443; Mon, 07 Nov 2022 05:57:14 -0800 (PST) Received: from localhost.localdomain ([47.246.101.56]) by smtp.gmail.com with ESMTPSA id w27-20020aa79a1b000000b00562ef28aac6sm4511383pfj.185.2022.11.07.05.57.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2022 05:57:14 -0800 (PST) From: Teng Long X-Google-Original-From: Teng Long To: dyroneteng@gmail.com Cc: avarab@gmail.com, git@vger.kernel.org, tenglong.tl@alibaba-inc.com Subject: [PATCH v2 1/3] notes.c: introduce "--blank-line" option Date: Mon, 7 Nov 2022 21:57:03 +0800 Message-Id: <2381947abdd6b965c02e114af297fc908ed3132b.1667828335.git.dyroneteng@gmail.com> X-Mailer: git-send-email 2.38.1.383.ge7205ac0a40.dirty In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Teng Long When appending to a given object which has note and if the appended note is not empty too, we will insert a blank line at first. The blank line serves as a split line, but sometimes we just want to omit it then append on the heels of the target note. So, we add a new "OPT_BOOL()" option to determain whether a new blank line is insert at first. Signed-off-by: Teng Long --- Documentation/git-notes.txt | 11 +++++++++-- builtin/notes.c | 5 ++++- t/t3301-notes.sh | 12 ++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt index efbc10f0f5..43770ddf84 100644 --- a/Documentation/git-notes.txt +++ b/Documentation/git-notes.txt @@ -11,7 +11,7 @@ SYNOPSIS 'git notes' [list []] 'git notes' add [-f] [--allow-empty] [-F | -m | (-c | -C) ] [] 'git notes' copy [-f] ( --stdin | [] ) -'git notes' append [--allow-empty] [-F | -m | (-c | -C) ] [] +'git notes' append [--allow-empty] [--blank-line] [-F | -m | (-c | -C) ] [] 'git notes' edit [--allow-empty] [] 'git notes' show [] 'git notes' merge [-v | -q] [-s ] @@ -86,7 +86,9 @@ the command can read the input given to the `post-rewrite` hook.) append:: Append to the notes of an existing object (defaults to HEAD). - Creates a new notes object if needed. + Creates a new notes object if needed. If the note of the given + object and the note to be appended are not empty, a blank line + will be inserted between them. edit:: Edit the notes for a given object (defaults to HEAD). @@ -159,6 +161,11 @@ OPTIONS Allow an empty note object to be stored. The default behavior is to automatically remove empty notes. +--blank-line:: +--no-blank-line:: + Controls if a blank line to split paragraphs is inserted + when appending (the default is true). + --ref :: Manipulate the notes tree in . This overrides `GIT_NOTES_REF` and the "core.notesRef" configuration. The ref diff --git a/builtin/notes.c b/builtin/notes.c index be51f69225..f0fa337e8c 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -562,6 +562,7 @@ static int copy(int argc, const char **argv, const char *prefix) static int append_edit(int argc, const char **argv, const char *prefix) { int allow_empty = 0; + int blankline = 1; const char *object_ref; struct notes_tree *t; struct object_id object, new_note; @@ -584,6 +585,8 @@ static int append_edit(int argc, const char **argv, const char *prefix) parse_reuse_arg), OPT_BOOL(0, "allow-empty", &allow_empty, N_("allow storing empty note")), + OPT_BOOL(0, "blank-line", &blankline, + N_("insert paragraph break before appending to an existing note")), OPT_END() }; int edit = !strcmp(argv[0], "edit"); @@ -619,7 +622,7 @@ static int append_edit(int argc, const char **argv, const char *prefix) char *prev_buf = read_object_file(note, &type, &size); strbuf_grow(&d.buf, size + 1); - if (d.buf.len && prev_buf && size) + if (blankline && d.buf.len && prev_buf && size) strbuf_insertstr(&d.buf, 0, "\n"); if (prev_buf && size) strbuf_insert(&d.buf, 0, prev_buf, size); diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index 3288aaec7d..76beafdeb8 100755 --- a/t/t3301-notes.sh +++ b/t/t3301-notes.sh @@ -521,12 +521,24 @@ test_expect_success 'listing non-existing notes fails' ' test_must_be_empty actual ' +test_expect_success 'append to existing note without a beginning blank line' ' + cat >expect <<-\EOF && + Initial set of notes + Appended notes + EOF + git notes add -m "Initial set of notes" && + git notes append --no-blank-line -m "Appended notes" && + git notes show >actual && + test_cmp expect actual +' + test_expect_success 'append to existing note with "git notes append"' ' cat >expect <<-EOF && Initial set of notes More notes appended with git notes append EOF + git notes remove HEAD && git notes add -m "Initial set of notes" && git notes append -m "More notes appended with git notes append" && git notes show >actual && From patchwork Mon Nov 7 13:57:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teng Long X-Patchwork-Id: 13034376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3722CC4332F for ; Mon, 7 Nov 2022 13:57:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231777AbiKGN50 (ORCPT ); Mon, 7 Nov 2022 08:57:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231675AbiKGN5R (ORCPT ); Mon, 7 Nov 2022 08:57:17 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFCC91CFFA for ; Mon, 7 Nov 2022 05:57:16 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id b21so11119570plc.9 for ; Mon, 07 Nov 2022 05:57:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aI+08zrLivwyVjiibRhNpnzzGyr8uvoueyFSqg9/Xfs=; b=fY/VQO5Y6u6sHsXO6x8/tR1Mqe47L7SPMEnrYih4xwkaKwKmOch+oZrw8Q7UoYhxo3 D7z8wohtxCasZX5YY5oQcLPUEz3hzWgckvULinZOf0qu9JBNsz9EKTd/WmiRQ6KKkPea NqsdWvEOU3+V0tCAKrA14AfzAmAaZqnSPFaLPcLhDxEY7HSGgPpacNK76Z8UBk+k+s0x E+cNNkIQXtgpd45YKnZYa0fxiUajGw8FP0W0UFDMs0JcXG380WD495ybHzFYxTNaee0x 6pWfF9cI5uzbUmmegCk4HSVrtKsZBkm0xsv4DiCrZ04gUk4k+L2iwBxLFcNsQx0Tffgi N1dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aI+08zrLivwyVjiibRhNpnzzGyr8uvoueyFSqg9/Xfs=; b=D8ax0Amxtr284NfwvbRYYebVyg9ob2+gOg5A/hnjGhWE1Yc8hX45o27cu+/54AyzcZ tDFdeQgNMWeBTJxYyFfO4v4EVn1Wqo/IsJ87EiD8N2ijPN1Z6yqhW7BCax2TULQiNXTo qfYFKis+bwSF5Tpfdcx9W4N1l6AOf0TQDFs5SptJ25N9Qwb0zI40l6uYziqhtZIyF6j/ 7YgWmq9IkbnacPLWtX4yBK4+Ea1gmhq5+BOmF8BzVQmUL8c3TkWpANI9/kh7OmP9zCvi OgARRX77TLPGuWAy7AvT1ziAlgvsY0XcSwZCuU7SbKKG4xoTwiEY+1DI+gxIG7sZUJjY vAaQ== X-Gm-Message-State: ANoB5pnwshOf6RB+33eLgsPoE+kiAaY5fB+w0Trs2hpAO8vnlM5DAUgs IZDMhlLafgxo3wRpcOaJCvLst+dJssA81own X-Google-Smtp-Source: AA0mqf7rRB/T4Lv1dyCias1KpHk2KOSBHjquTNKQ6q5+G1OQ9SEhKQ+mLfJSoCAwaNgfGX68+rc9Cg== X-Received: by 2002:a17:902:a40a:b0:188:71b1:8f0f with SMTP id p10-20020a170902a40a00b0018871b18f0fmr13725134plq.112.1667829436240; Mon, 07 Nov 2022 05:57:16 -0800 (PST) Received: from localhost.localdomain ([47.246.101.56]) by smtp.gmail.com with ESMTPSA id w27-20020aa79a1b000000b00562ef28aac6sm4511383pfj.185.2022.11.07.05.57.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2022 05:57:15 -0800 (PST) From: Teng Long X-Google-Original-From: Teng Long To: dyroneteng@gmail.com Cc: avarab@gmail.com, git@vger.kernel.org, tenglong.tl@alibaba-inc.com Subject: [PATCH v2 2/3] notes.c: fixed tip when target and append note are both empty Date: Mon, 7 Nov 2022 21:57:04 +0800 Message-Id: <5dbe014a09cca6ffa01dc9f61d0ddc095d31d518.1667828335.git.dyroneteng@gmail.com> X-Mailer: git-send-email 2.38.1.383.ge7205ac0a40.dirty In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Teng Long When "git notes append " is executed, if there is no note in the given object and the appended note is empty, the command line prompt will be as follows: "Removing note for object " Actually, this tip is not that accurate, because there is no note in the original , and it also does no remove work on the notes reference, so let's fix this and give the correct tip. Signed-off-by: Teng Long --- builtin/notes.c | 17 ++++++++++++++--- t/t3301-notes.sh | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index f0fa337e8c..02b88e54d8 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -567,9 +567,15 @@ static int append_edit(int argc, const char **argv, const char *prefix) struct notes_tree *t; struct object_id object, new_note; const struct object_id *note; - char *logmsg; + char *logmsg = NULL; const char * const *usage; - struct note_data d = { 0, 0, NULL, STRBUF_INIT }; + struct note_data d = { + .given = 0, + .use_editor = 0, + .edit_path = NULL, + .buf = STRBUF_INIT + }; + struct option options[] = { OPT_CALLBACK_F('m', "message", &d, N_("message"), N_("note contents as a string"), PARSE_OPT_NONEG, @@ -634,13 +640,18 @@ static int append_edit(int argc, const char **argv, const char *prefix) if (add_note(t, &object, &new_note, combine_notes_overwrite)) BUG("combine_notes_overwrite failed"); logmsg = xstrfmt("Notes added by 'git notes %s'", argv[0]); + commit_notes(the_repository, t, logmsg); + } else if (!d.buf.len && !note) { + fprintf(stderr, + _("Both original and appended notes are empty in %s, do nothing\n"), + oid_to_hex(&object)); } else { fprintf(stderr, _("Removing note for object %s\n"), oid_to_hex(&object)); remove_note(t, object.hash); logmsg = xstrfmt("Notes removed by 'git notes %s'", argv[0]); + commit_notes(the_repository, t, logmsg); } - commit_notes(the_repository, t, logmsg); free(logmsg); free_note_data(&d); diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index 76beafdeb8..1a0fd157a5 100755 --- a/t/t3301-notes.sh +++ b/t/t3301-notes.sh @@ -574,7 +574,8 @@ test_expect_success 'git notes append == add when there is no existing note' ' test_expect_success 'appending empty string to non-existing note does not create note' ' git notes remove HEAD && test_must_fail git notes list HEAD && - git notes append -m "" && + git notes append -m "" >output 2>&1 && + grep "Both original and appended notes are empty" output && test_must_fail git notes list HEAD ' From patchwork Mon Nov 7 13:57:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teng Long X-Patchwork-Id: 13034377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B1C4C433FE for ; Mon, 7 Nov 2022 13:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231825AbiKGN52 (ORCPT ); Mon, 7 Nov 2022 08:57:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231701AbiKGN5T (ORCPT ); Mon, 7 Nov 2022 08:57:19 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 732681D0EF for ; Mon, 7 Nov 2022 05:57:18 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id c15-20020a17090a1d0f00b0021365864446so10347107pjd.4 for ; Mon, 07 Nov 2022 05:57:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FpOJtrcZ2ChND9hM7TadVyWqECeKR8W8pnfYdbw+juY=; b=UtEcRkap9B7a6dUU61DU92FXolrh1ZWnS3LQXWadQSLneP5zmrM6bhjpylh8yrdHv4 mJmphX+gIAdmV+vR6dFDy734movbl1ehg8eg/5qo9am2sD9IdxJ2Q9NGuBqH0AfWgADi pD+TAbZMv1JeRijrI6rizMVShJ2+VEfT2xpTFMLUWcLcXmrkXSkqs0K+IIGN4hjtwcl9 I63I4kliEBxObb0XpYsQLKdTcFrCZoGKbbTb8UtH5cWvLwRvko7lHHx+jReXRdSvyWIG Gpo9JW5ZbT4NhNA7bhJxwlA/Ac6yuAJ3vtbk3+MnJHGQY14wYGuAK4btP7Z/TArcOEzq TNUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FpOJtrcZ2ChND9hM7TadVyWqECeKR8W8pnfYdbw+juY=; b=Ie6CA0UMGh6Zs58zfFa9LpF4Zgd7OdQKTdJDSV5cvgIhO/FgOmnkYNTTIWQNYCeS6f IzXqjZFUDaRIZhUptRHlrCQ/apowhujJqPmq7QITlNbOz06LuixV3fIMgFNyydjV22Cs 77Rj+HHjCDMvIjRw1c+1Xl5P0W1mOTsL2X3RcVNErKdW1cCw+Z6lK5jiI1B9seMiFhrz 3+yiuvjp5BsdjhxXA/LHXF9vRFvRVhj9BhH5uVmhuHKivXs0xpL9lt1BfaqeMGx7NmyQ JW6CA8NJkCXJ6YqZFJnPRaCe6pHeJFmvL/8oUzNQZzo21nkjDvAzwP7jwSFdHWCE5n3l NnzA== X-Gm-Message-State: ACrzQf0OEYylWNtz1i+hA0liUGaxSdShCqccEfrVi4mO5Chat9SFBDE4 IYQUSDwxltrMvAj9dShD/0oZZTOcQDKnZaCR X-Google-Smtp-Source: AMsMyM5Xcds7Y9lM34x4dF72+g4RYvVTuKXFGdtRRZYafy8O+Lt55uPjV7rRr4yBkbYgoGQrMCojlQ== X-Received: by 2002:a17:903:248:b0:172:7520:db07 with SMTP id j8-20020a170903024800b001727520db07mr50787022plh.76.1667829437965; Mon, 07 Nov 2022 05:57:17 -0800 (PST) Received: from localhost.localdomain ([47.246.101.56]) by smtp.gmail.com with ESMTPSA id w27-20020aa79a1b000000b00562ef28aac6sm4511383pfj.185.2022.11.07.05.57.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2022 05:57:17 -0800 (PST) From: Teng Long X-Google-Original-From: Teng Long To: dyroneteng@gmail.com Cc: avarab@gmail.com, git@vger.kernel.org, tenglong.tl@alibaba-inc.com Subject: [PATCH v2 3/3] notes.c: drop unreachable code in "append_edit()" Date: Mon, 7 Nov 2022 21:57:05 +0800 Message-Id: <2475ea0c04d7b5e2812f13d0c8701a0056b305b8.1667828335.git.dyroneteng@gmail.com> X-Mailer: git-send-email 2.38.1.383.ge7205ac0a40.dirty In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Teng Long Situation of removing note shouldn't happen in "append_edit()", unless it's a bug. So, let's drop the unreachable "else" code in "append_edit()". Signed-off-by: Teng Long --- builtin/notes.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index 02b88e54d8..6d42592c79 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -10,6 +10,7 @@ #include "cache.h" #include "config.h" #include "builtin.h" +#include "git-compat-util.h" #include "notes.h" #include "object-store.h" #include "repository.h" @@ -646,11 +647,7 @@ static int append_edit(int argc, const char **argv, const char *prefix) _("Both original and appended notes are empty in %s, do nothing\n"), oid_to_hex(&object)); } else { - fprintf(stderr, _("Removing note for object %s\n"), - oid_to_hex(&object)); - remove_note(t, object.hash); - logmsg = xstrfmt("Notes removed by 'git notes %s'", argv[0]); - commit_notes(the_repository, t, logmsg); + BUG("compute_notes failed"); } free(logmsg);