git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 1

It 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.

Previous: Santi BéjarNext: Junio C Hamano
Message 12 of 14 in “git-what: explain what to do next”
  1. git-what: explain what to do nextSanti Béjar, May 27, 2008
  2. Johannes SchindelinMay 27, 2008
  3. Santi BéjarMay 27, 2008
  4. Johannes SchindelinMay 27, 2008
  5. Santi BéjarMay 27, 2008
  6. Stephen R. van den BergMay 27, 2008
  7. Santi BéjarMay 27, 2008
  8. Steven WalterMay 27, 2008
  9. Junio C HamanoMay 27, 2008
  10. Junio C HamanoMay 27, 2008
  11. Santi BéjarMay 28, 2008
  12. Christian CouderMay 29, 2008
  13. Junio C HamanoMay 29, 2008
  14. Jon LoeligerMay 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.