From: Junio C Hamano <gitster@pobox.com>
To: David Turner <dturner@twopensource.com>
Cc: git@vger.kernel.org, mhagger@alum.mit.edu
Subject: Re: [PATCH v2 3/6] bisect: use refs infrastructure for BISECT_START
Date: Thu, 25 Jun 2015 13:52:40 -0700 [thread overview]
Message-ID: <xmqq616by0h3.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1435265110-6414-3-git-send-email-dturner@twopensource.com> (David Turner's message of "Thu, 25 Jun 2015 16:45:07 -0400")
David Turner <dturner@twopensource.com> writes:
> This ref needs to go through the refs backend, since some code assumes
> that it can be written and read as a ref.
And the reason why BISECT_HEAD cannot be treated as a ref, but must
be treated as a file under $GIT_DIR, is...?
>
> Signed-off-by: David Turner <dturner@twopensource.com>
> ---
> contrib/completion/git-completion.bash | 2 +-
> git-bisect.sh | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 93716c4..c4d4d80 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -938,7 +938,7 @@ _git_bisect ()
> local subcommands="start bad good skip reset visualize replay log run"
> local subcommand="$(__git_find_on_cmdline "$subcommands")"
> if [ -z "$subcommand" ]; then
> - if [ -f "$(__gitdir)"/BISECT_START ]; then
> + if [ git rev-parse BISECT_START 2>/dev/null ]; then
> __gitcomp "$subcommands"
> else
> __gitcomp "replay start"
> diff --git a/git-bisect.sh b/git-bisect.sh
> index ae3fec2..8658772 100755
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -166,7 +166,7 @@ bisect_start() {
> #
> echo "$start_head" >"$GIT_DIR/BISECT_START" && {
> test "z$mode" != "z--no-checkout" ||
> - git update-ref --no-deref BISECT_HEAD "$start_head"
> + git rev-parse "$start_head" > "$GIT_DIR/BISECT_HEAD"
> } &&
> git rev-parse --sq-quote "$@" >"$GIT_DIR/BISECT_NAMES" &&
> eval "$eval true" &&
> @@ -399,7 +399,7 @@ bisect_clean_state() {
> rm -f "$GIT_DIR/BISECT_RUN" &&
> # Cleanup head-name if it got left by an old version of git-bisect
> rm -f "$GIT_DIR/head-name" &&
> - git update-ref -d --no-deref BISECT_HEAD &&
> + rm -f "$GIT_DIR/BISECT_HEAD" &&
> # clean up BISECT_START last
> rm -f "$GIT_DIR/BISECT_START"
> }
next prev parent reply other threads:[~2015-06-25 20:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 20:45 [PATCH v2 1/6] refs.c: add err arguments to reflog functions David Turner
2015-06-25 20:45 ` [PATCH v2 2/6] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs David Turner
2015-06-25 21:11 ` Junio C Hamano
2015-06-25 22:29 ` David Turner
2015-06-25 20:45 ` [PATCH v2 3/6] bisect: use refs infrastructure for BISECT_START David Turner
2015-06-25 20:52 ` Junio C Hamano [this message]
2015-06-25 23:21 ` David Turner
2015-06-26 0:22 ` David Turner
2015-06-25 20:45 ` [PATCH v2 4/6] refs: add safe_create_reflog function David Turner
2015-06-25 21:02 ` Junio C Hamano
2015-06-25 20:45 ` [PATCH v2 5/6] git-reflog: add create and exists functions David Turner
2015-06-25 21:01 ` Junio C Hamano
2015-06-25 21:51 ` David Turner
2015-06-25 20:45 ` [PATCH v2 6/6] git-stash: use git-reflog instead of creating files David Turner
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=xmqq616by0h3.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
/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.