Re: [PATCH v2 3/6] bisect: use refs infrastructure for BISECT_START
On Thu, 2015-06-25 at 19:21 -0400, David Turner wrote: > On Thu, 2015-06-25 at 13:52 -0700, Junio C Hamano wrote: > > David Turner 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...? > > After running some tests on the long version of the series, we can and > should move it into the backend; will add a patch to the next reroll Actually, I've looked into this further. BISECT_START isn't a ref because it contains the ref name that the bisection started from (not a symbolic ref). BISECT_HEAD is a ref. Will fix. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 3/6] bisect: use refs infrastructure for BISECT_START
On Thu, 2015-06-25 at 13:52 -0700, Junio C Hamano wrote: > David Turner 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...? After running some tests on the long version of the series, we can and should move it into the backend; will add a patch to the next reroll -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 3/6] bisect: use refs infrastructure for BISECT_START
David Turner 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 > --- > 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" > } -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 3/6] bisect: use refs infrastructure for BISECT_START
This ref needs to go through the refs backend, since some code assumes that it can be written and read as a ref. Signed-off-by: David Turner --- 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" } -- 2.0.4.314.gdbf7a51-twtrsrc -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html