From: "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: [PATCH v3 0/4] Use refs API for handling sundry pseudorefs
Date: Fri, 21 Aug 2020 16:59:33 +0000 [thread overview]
Message-ID: <pull.706.v3.git.1598029177.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.706.v2.git.1597850128.gitgitgadget@gmail.com>
This series changes the handling of CHERRY_PICK_HEAD and REVERT_HEAD to use
the refs API, as a preliminary refactor for reftable.
No functional changes.
Han-Wen Nienhuys (4):
refs: make refs_ref_exists public
sequencer: treat CHERRY_PICK_HEAD as a pseudo ref
builtin/commit: suggest update-ref for pseudoref removal
sequencer: treat REVERT_HEAD as a pseudo ref
builtin/commit.c | 26 +++++++++++-----------
builtin/merge.c | 2 +-
path.c | 2 --
path.h | 9 ++++----
refs.c | 2 +-
refs.h | 2 ++
sequencer.c | 56 +++++++++++++++++++++++++++++-------------------
wt-status.c | 6 +++---
8 files changed, 57 insertions(+), 48 deletions(-)
base-commit: 675a4aaf3b226c0089108221b96559e0baae5de9
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-706%2Fhanwen%2Fstray-pseudorefs-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-706/hanwen/stray-pseudorefs-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/706
Range-diff vs v2:
1: a8467a0d66 = 1: bfea176682 refs: make refs_ref_exists public
2: 2797e98446 = 2: 5ff5d2c663 sequencer: treat CHERRY_PICK_HEAD as a pseudo ref
3: 2681638651 ! 3: 8aacde69c8 builtin/commit: suggest update-ref for pseudoref removal
@@ Commit message
## builtin/commit.c ##
@@ builtin/commit.c: static int prepare_to_commit(const char *index_file, const char *prefix,
- struct ident_split ci, ai;
-
- if (whence != FROM_COMMIT) {
-+ const char *pseudoref = (whence == FROM_MERGE) ?
-+ "MERGE_HEAD" :
-+ "CHERRY_PICK_HEAD";
-+ const char *what = (whence == FROM_MERGE) ?
-+ "merge" :
-+ "cherry-pick";
-+
if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS &&
!merge_contains_scissors)
wt_status_add_cut_line(s->fp);
@@ builtin/commit.c: static int prepare_to_commit(const char *index_file, const cha
- "If this is not correct, please remove the file\n"
- " %s\n"
- "and try again.\n"),
-- whence == FROM_MERGE ?
-- git_path_merge_head(the_repository) :
-- git_path_cherry_pick_head(the_repository));
+ status_printf_ln(
+ s, GIT_COLOR_NORMAL,
-+ _("\n"
-+ "It looks like you may be committing a %s.\n"
-+ "If this is not correct, please remove %s with\n"
-+ " git update-ref -d %s\n"
-+ "and try again.\n"),
-+ what, pseudoref, pseudoref);
+ 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");
4: 9dcc10f807 = 4: 9ba0136645 sequencer: treat REVERT_HEAD as a pseudo ref
--
gitgitgadget
next prev 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 ` Han-Wen Nienhuys via GitGitGadget [this message]
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 ` [PATCH v3 3/4] builtin/commit: suggest update-ref for pseudoref removal Han-Wen Nienhuys via GitGitGadget
2020-08-21 16:59 ` [PATCH v3 4/4] sequencer: treat REVERT_HEAD as a pseudo ref 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.706.v3.git.1598029177.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.