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

Re: [PATCH v11 06/10] bisect: don't mix option parsing and non-trivial code

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 29, 2015, 20:28 UTC
Message-ID
<xmqqbnfy9s3v.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1435592435-27914-7-git-send-email-Matthieu.Moy@imag.fr>

Matthieu, are you allowing your editor to corrupt the number of lines in the hunk on the @@ ... @@ hunk header? "diff" mode in Emacs does that, and there may be other editors that has the same bug, but please be careful---they make the patch unapplicable.

Count the preimage lines in the hunk below. I count 24 but somebody is lying there.

Show 43 quoted lines
> @@ -102,25 +103,27 @@ bisect_start() {
>  				die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
>  				break
>  			}
> -
> -			# The user ran "git bisect start <sha1>
> -			# <sha1>", hence did not explicitly specify
> -			# the terms, but we are already starting to
> -			# set references named with the default terms,
> -			# and won't be able to change afterwards.
> -			must_write_terms=1
> -
> -			case $bad_seen in
> -			0) state=$TERM_BAD ; bad_seen=1 ;;
> -			*) state=$TERM_GOOD ;;
> -			esac
> -			eval="$eval bisect_write '$state' '$rev' 'nolog' &&"
> +			revs="$revs $rev"
>  			shift
>  			;;
>  		esac
>  	done
>  
> +	for rev in $revs
> +	do
> +		# The user ran "git bisect start <sha1>
> +		# <sha1>", hence did not explicitly specify
> +		# the terms, but we are already starting to
> +		# set references named with the default terms,
> +		# and won't be able to change afterwards.
> +		must_write_terms=1
> +
> +		case $bad_seen in
> +		0) state=$TERM_BAD ; bad_seen=1 ;;
> +		*) state=$TERM_GOOD ;;
> +		esac
> +		eval="$eval bisect_write '$state' '$rev' 'nolog' &&"
> +	done
>  	#
>  	# Verify HEAD.
>  	#
> -- 
> 2.5.0.rc0.10.gd2bff5d
Previous: Matthieu MoyNext: Matthieu Moy
Message 8 of 15 in “bisect terms”
  1. 00/10 bisect termsMatthieu Moy, Jun 29, 2015
  2. 01/10 bisect: correction of typoMatthieu Moy, Jun 29, 2015
  3. 02/10 Documentation/bisect: move getting help section to the endMatthieu Moy, Jun 29, 2015
  4. 03/10 Documentation/bisect: revise overall contentMatthieu Moy, Jun 29, 2015
  5. 04/10 bisect: replace hardcoded "bad|good" by variablesMatthieu Moy, Jun 29, 2015
  6. 05/10 bisect: simplify the addition of new bisect termsMatthieu Moy, Jun 29, 2015
  7. 06/10 bisect: don't mix option parsing and non-trivial codeMatthieu Moy, Jun 29, 2015
  8. Junio C HamanoJun 29, 2015
  9. Matthieu MoyJun 30, 2015
  10. Junio C HamanoJun 30, 2015
  11. 07/10 bisect: sanity check on termsMatthieu Moy, Jun 29, 2015
  12. 08/10 bisect: add the terms old/newMatthieu Moy, Jun 29, 2015
  13. 09/10 bisect: add 'git bisect terms' to view the current termsMatthieu Moy, Jun 29, 2015
  14. 10/10 bisect: allow setting any user-specified in 'git bisect start'Matthieu Moy, Jun 29, 2015
  15. Junio C HamanoJun 29, 2015

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.