git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwenn@gmail.com>,
	Han-Wen Nienhuys <hanwen@google.com>
Subject: [PATCH v3 3/4] builtin/commit: suggest update-ref for pseudoref removal
Date: Fri, 21 Aug 2020 16:59:36 +0000	[thread overview]
Message-ID: <8aacde69c8c4689b6b68f11a310a308595ed49ad.1598029177.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.706.v3.git.1598029177.gitgitgadget@gmail.com>

From: Han-Wen Nienhuys <hanwen@google.com>

When pseudorefs move to a different ref storage mechanism, pseudorefs no longer
can be removed with 'rm'. Instead, suggest a "update-ref -d" command, which will
work regardless of ref storage backend.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 builtin/commit.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 69ac78d5e5..671721c385 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -847,21 +847,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 			if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS &&
 				!merge_contains_scissors)
 				wt_status_add_cut_line(s->fp);
-			status_printf_ln(s, GIT_COLOR_NORMAL,
-			    whence == FROM_MERGE
-				? _("\n"
-					"It looks like you may be committing a merge.\n"
-					"If this is not correct, please remove the file\n"
-					"	%s\n"
-					"and try again.\n")
-				: _("\n"
-					"It looks like you may be committing a cherry-pick.\n"
-					"If this is not correct, please remove the file\n"
-					"	%s\n"
-					"and try again.\n"),
+			status_printf_ln(
+				s, GIT_COLOR_NORMAL,
 				whence == FROM_MERGE ?
-					git_path_merge_head(the_repository) :
-					git_path_cherry_pick_head(the_repository));
+					      _("\n"
+					  "It looks like you may be committing a merge.\n"
+					  "If this is not correct, please run\n"
+					  "	git update-ref -d MERGE_HEAD\n"
+					  "and try again.\n") :
+					      _("\n"
+					  "It looks like you may be committing a cherry-pick.\n"
+					  "If this is not correct, please run\n"
+					  "	git update-ref -d CHERRY_PICK_HEAD\n"
+					  "and try again.\n"));
 		}
 
 		fprintf(s->fp, "\n");
-- 
gitgitgadget


  parent reply	other threads:[~2020-08-21 17:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 12:17 [PATCH 0/3] Use refs API for handling sundry pseudorefs Han-Wen Nienhuys via GitGitGadget
2020-08-18 12:17 ` [PATCH 1/3] Make refs_ref_exists public Han-Wen Nienhuys via GitGitGadget
2020-08-18 20:39   ` Junio C Hamano
2020-08-18 12:17 ` [PATCH 2/3] Treat CHERRY_PICK_HEAD as a pseudo ref Han-Wen Nienhuys via GitGitGadget
2020-08-18 21:05   ` Junio C Hamano
2020-08-19 15:04     ` Han-Wen Nienhuys
2020-08-19 16:14       ` Junio C Hamano
2020-08-18 12:17 ` [PATCH 3/3] Treat REVERT_HEAD " Han-Wen Nienhuys via GitGitGadget
2020-08-18 21:06   ` Junio C Hamano
2020-08-18 20:33 ` [PATCH 0/3] Use refs API for handling sundry pseudorefs Junio C Hamano
2020-08-19 15:15 ` [PATCH v2 0/4] " Han-Wen Nienhuys via GitGitGadget
2020-08-19 15:15   ` [PATCH v2 1/4] refs: make refs_ref_exists public Han-Wen Nienhuys via GitGitGadget
2020-08-19 15:15   ` [PATCH v2 2/4] sequencer: treat CHERRY_PICK_HEAD as a pseudo ref Han-Wen Nienhuys via GitGitGadget
2020-08-19 15:15   ` [PATCH v2 3/4] builtin/commit: suggest update-ref for pseudoref removal Han-Wen Nienhuys via GitGitGadget
2020-08-19 21:24     ` Junio C Hamano
2020-08-21 14:57       ` Han-Wen Nienhuys
2020-08-19 15:15   ` [PATCH v2 4/4] sequencer: treat REVERT_HEAD as a pseudo ref Han-Wen Nienhuys via GitGitGadget
2020-08-21 16:59   ` [PATCH v3 0/4] Use refs API for handling sundry pseudorefs Han-Wen Nienhuys via GitGitGadget
2020-08-21 16:59     ` [PATCH v3 1/4] refs: make refs_ref_exists public Han-Wen Nienhuys via GitGitGadget
2020-08-21 16:59     ` [PATCH v3 2/4] sequencer: treat CHERRY_PICK_HEAD as a pseudo ref Han-Wen Nienhuys via GitGitGadget
2020-08-21 16:59     ` Han-Wen Nienhuys via GitGitGadget [this message]
2020-08-21 16:59     ` [PATCH v3 4/4] sequencer: treat REVERT_HEAD " Han-Wen Nienhuys via GitGitGadget
2020-08-21 18:34     ` [PATCH v3 0/4] Use refs API for handling sundry pseudorefs Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8aacde69c8c4689b6b68f11a310a308595ed49ad.1598029177.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hanwen@google.com \
    --cc=hanwenn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).