Re: [RFC/PATCH] git-what: explain what to do next
- From
Christian Couder <chriscool@tuxfamily.org>
- Date
- May 29, 2008, 04:39 UTC
- Message-ID
- <200805290639.38134.chriscool@tuxfamily.org>
- In-Reply-To
- <1211877299-27255-1-git-send-email-sbejar@gmail.com>
Le mardi 27 mai 2008, Santi Béjar a écrit :
> In case you don't know the next step, if it is "git commit", > "git commit --amend", "git rebase --continue" or something else.
[...]
Show 18 quoted lines
> diff --git a/git-bisect.sh b/git-bisect.sh > index 4bcbace..27d3946 100755 > --- a/git-bisect.sh > +++ b/git-bisect.sh > @@ -1,6 +1,6 @@ > #!/bin/sh > > -USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run]' > +USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run|wha >t]' LONG_USAGE='git bisect help > print this long help message. > git bisect start [<bad> [<good>...]] [--] [<pathspec>...] > @@ -23,6 +23,8 @@ git bisect log > show bisect log. > git bisect run <cmd>... > use <cmd>... to automatically bisect. > +git bisect what... > + explain what to do if in the midle of a bisect.
Perhaps it's better to add something like this first:
git bisect status show the current bisect state
It could tell if we are currently bisecting and show the "good", "bad" and "skip"ped revs and the content of the BISECT_START and BISECT_NAMES (and perhaps BISECT_RUN) files.
Show 59 quoted lines
> Please use "git help bisect" to get the full man page.'
>
> @@ -206,6 +208,14 @@ bisect_next_check() {
> test -n "$(git for-each-ref "refs/bisect/good-*")" || missing_good=t
>
> case "$missing_good,$missing_bad,$1" in
> + ,,what)
> + # have both good and bad - ok
> + echo "Test the commit and mark it as"
> + echo "bad) $ git bisect bad"
> + echo "good) $ git bisect good"
> + echo "skip) $ git bisect skip"
> + exit
> + ;;
> ,,*)
>
> : have both good and bad - ok
>
> ;;
> @@ -213,6 +223,16 @@ bisect_next_check() {
> # do not have both but not asked to fail - just report.
> false
> ;;
> + ,t,what)
> + # have good but not bad.
> + echo "No bad commit, mark one with \"git bisect bad <rev>"\"
> + exit
> + ;;
> + t,,what)
> + # have bad but not good.
> + echo "No good commit, mark one with \"git bisect good <rev>\""
> + exit
> + ;;
> t,,good)
> # have bad but not good. we could bisect although
> # this is less optimum.
> @@ -224,6 +244,14 @@ bisect_next_check() {
> fi
>
> : bisect without good...
>
> ;;
> + t,t,what)
> + # TODO: Reuse the text in the next case
> + echo 'You need to give me at least one good' \
> + 'and one bad revisions.'
> + echo '(You can use "git bisect bad" and' \
> + '"git bisect good" for that.)'
> + exit
> + ;;
> *)
> THEN=''
> test -f "$GIT_DIR/BISECT_NAMES" || {
> @@ -497,6 +525,11 @@ bisect_run () {
> done
> }
>
> +bisect_what () {
> + test -s "$GIT_DIR/BISECT_START" || return 1It seems not very friendly to just "return 1" when not bisecting. And before my last patch to use BISECT_START to check if we are bisecting, it would perhaps have been better to use 'test -f "$GIT_DIR/BISECT_NAMES"'.
Thanks, Christian.