git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: [PATCH v2 0/4] Use refs API for handling sundry pseudorefs
Date: Wed, 19 Aug 2020 15:15:23 +0000	[thread overview]
Message-ID: <pull.706.v2.git.1597850128.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.706.git.1597753075.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 | 30 +++++++++++++-------------
 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, 60 insertions(+), 49 deletions(-)


base-commit: 2befe97201e1f3175cce557866c5822793624b5a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-706%2Fhanwen%2Fstray-pseudorefs-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-706/hanwen/stray-pseudorefs-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/706

Range-diff vs v1:

 1:  5e29fa74dc ! 1:  a8467a0d66 Make refs_ref_exists public
     @@ Metadata
      Author: Han-Wen Nienhuys <hanwen@google.com>
      
       ## Commit message ##
     -    Make refs_ref_exists public
     +    refs: make refs_ref_exists public
     +
     +    This will be necessary to replace file existence checks for pseudorefs.
      
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
 2:  06a8e8cbd1 ! 2:  2797e98446 Treat CHERRY_PICK_HEAD as a pseudo ref
     @@ Metadata
      Author: Han-Wen Nienhuys <hanwen@google.com>
      
       ## Commit message ##
     -    Treat CHERRY_PICK_HEAD as a pseudo ref
     +    sequencer: treat CHERRY_PICK_HEAD as a pseudo ref
      
          Check for existence and delete CHERRY_PICK_HEAD through ref functions.
          This will help cherry-pick work with alternate ref storage backends.
      
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
     - ## builtin/commit.c ##
     -@@ builtin/commit.c: 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"),
     --				whence == FROM_MERGE ?
     --					git_path_merge_head(the_repository) :
     --					git_path_cherry_pick_head(the_repository));
     -+			if (whence == FROM_MERGE)
     -+				status_printf_ln(
     -+					s, GIT_COLOR_NORMAL,
     -+
     -+					_("\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"),
     -+					git_path_merge_head(the_repository));
     -+			else
     -+				status_printf_ln(
     -+					s, GIT_COLOR_NORMAL,
     -+
     -+					_("\n"
     -+					  "It looks like you may be committing a cherry-pick.\n"
     -+					  "If this is not correct, please run\n"
     -+					  "	git cherry-pick --abort\n"
     -+					  "and try again.\n"));
     - 		}
     - 
     - 		fprintf(s->fp, "\n");
     -
       ## builtin/merge.c ##
      @@ builtin/merge.c: int cmd_merge(int argc, const char **argv, const char *prefix)
       		else
 -:  ---------- > 3:  2681638651 builtin/commit: suggest update-ref for pseudoref removal
 3:  173d81dbb4 ! 4:  9dcc10f807 Treat REVERT_HEAD as a pseudo ref
     @@ Metadata
      Author: Han-Wen Nienhuys <hanwen@google.com>
      
       ## Commit message ##
     -    Treat REVERT_HEAD as a pseudo ref
     +    sequencer: treat REVERT_HEAD as a pseudo ref
      
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      

-- 
gitgitgadget

  parent reply	other threads:[~2020-08-19 15:15 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 ` Han-Wen Nienhuys via GitGitGadget [this message]
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     ` [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.v2.git.1597850128.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 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 NNTP newsgroup(s).