Re: [PATCH] bisect: add quit command

2017-03-25 Thread Edmundo Carmona Antoranz
I found out about "git bisect reset HEAD" while working on "git bisect
quit" but I think it's still worth it.

Let me know.

On Sat, Mar 25, 2017 at 3:17 PM, Edmundo Carmona Antoranz
 wrote:
> git bisect quit will call git reset HEAD so that the working tree
> remains at the current revision
> ---
>  Documentation/git-bisect.txt | 12 
>  git-bisect.sh| 11 ++-
>  2 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
> index bdd915a66..de79e9e44 100644
> --- a/Documentation/git-bisect.txt
> +++ b/Documentation/git-bisect.txt
> @@ -23,6 +23,7 @@ on the subcommand:
>   git bisect terms [--term-good | --term-bad]
>   git bisect skip [(|)...]
>   git bisect reset []
> + git bisect quit
>   git bisect visualize
>   git bisect replay 
>   git bisect log
> @@ -120,6 +121,17 @@ bad revision, while `git bisect reset HEAD` will leave 
> you on the
>  current bisection commit and avoid switching commits at all.
>
>
> +Bisect quit
> +~~~
> +
> +It's an equivalent of bisect reset but that stays at the current
> +revision instead of taking your working tree to the starting revision.
> +
> +
> +$ git bisect quit
> +
> +
> +
>  Alternate terms
>  ~~~
>
> diff --git a/git-bisect.sh b/git-bisect.sh
> index ae3cb013e..adbff2c69 100755
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>
> -USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|replay|log|run]'
> +USAGE='[help|start|bad|good|new|old|terms|skip|next|quit|reset|visualize|replay|log|run]'
>  LONG_USAGE='git bisect help
> print this long help message.
>  git bisect start [--term-{old,good}= --term-{new,bad}=]
> @@ -20,6 +20,9 @@ git bisect next
> find next bisection to test and check it out.
>  git bisect reset []
> finish bisection search and go back to commit.
> +git bisect quit
> +   stop bisection on its tracks and stay on current revision.
> +   Equivalent to git bisect reset HEAD
>  git bisect visualize
> show bisect status in gitk.
>  git bisect replay 
> @@ -433,6 +436,10 @@ Try 'git bisect reset '.")"
> bisect_clean_state
>  }
>
> +bisect_quit() {
> +   bisect_reset "HEAD"
> +}
> +
>  bisect_clean_state() {
> # There may be some refs packed during bisection.
> git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\* |
> @@ -683,6 +690,8 @@ case "$#" in
> bisect_visualize "$@" ;;
> reset)
> bisect_reset "$@" ;;
> +   quit)
> +   bisect_quit ;;
> replay)
> bisect_replay "$@" ;;
> log)
> --
> 2.11.0.rc1
>


[PATCH] bisect: add quit command

2017-03-25 Thread Edmundo Carmona Antoranz
git bisect quit will call git reset HEAD so that the working tree
remains at the current revision
---
 Documentation/git-bisect.txt | 12 
 git-bisect.sh| 11 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index bdd915a66..de79e9e44 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -23,6 +23,7 @@ on the subcommand:
  git bisect terms [--term-good | --term-bad]
  git bisect skip [(|)...]
  git bisect reset []
+ git bisect quit
  git bisect visualize
  git bisect replay 
  git bisect log
@@ -120,6 +121,17 @@ bad revision, while `git bisect reset HEAD` will leave you 
on the
 current bisection commit and avoid switching commits at all.
 
 
+Bisect quit
+~~~
+
+It's an equivalent of bisect reset but that stays at the current
+revision instead of taking your working tree to the starting revision.
+
+
+$ git bisect quit
+
+
+
 Alternate terms
 ~~~
 
diff --git a/git-bisect.sh b/git-bisect.sh
index ae3cb013e..adbff2c69 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|replay|log|run]'
+USAGE='[help|start|bad|good|new|old|terms|skip|next|quit|reset|visualize|replay|log|run]'
 LONG_USAGE='git bisect help
print this long help message.
 git bisect start [--term-{old,good}= --term-{new,bad}=]
@@ -20,6 +20,9 @@ git bisect next
find next bisection to test and check it out.
 git bisect reset []
finish bisection search and go back to commit.
+git bisect quit
+   stop bisection on its tracks and stay on current revision.
+   Equivalent to git bisect reset HEAD
 git bisect visualize
show bisect status in gitk.
 git bisect replay 
@@ -433,6 +436,10 @@ Try 'git bisect reset '.")"
bisect_clean_state
 }
 
+bisect_quit() {
+   bisect_reset "HEAD"
+}
+
 bisect_clean_state() {
# There may be some refs packed during bisection.
git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\* |
@@ -683,6 +690,8 @@ case "$#" in
bisect_visualize "$@" ;;
reset)
bisect_reset "$@" ;;
+   quit)
+   bisect_quit ;;
replay)
bisect_replay "$@" ;;
log)
-- 
2.11.0.rc1