Re: [PATCH v9 4/5] bisect: add the terms old/new
On Thu, Jun 25, 2015 at 8:50 PM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
[...]
Show 9 quoted lines
> @@ -178,7 +183,7 @@ bisect_start() {
> } &&
> git rev-parse --sq-quote "$@" >"$GIT_DIR/BISECT_NAMES" &&
> eval "$eval true" &&
> - if test $revision_seen -eq 1 && test ! -s "$GIT_DIR/BISECT_TERMS"
> + if test $must_write_terms -eq 1 && test ! -s "$GIT_DIR/BISECT_TERMS"
> then
> echo "$NAME_BAD" >"$GIT_DIR/BISECT_TERMS" &&
> echo "$NAME_GOOD" >>"$GIT_DIR/BISECT_TERMS"You are writing BISECT_TERMS here...
Show 12 quoted lines
> @@ -543,14 +548,22 @@ check_and_set_terms () {
> fi
> NAME_BAD="bad"
> NAME_GOOD="good" ;;
> + new|old)
> + if ! test -s "$GIT_DIR/BISECT_TERMS"
> + then
> + echo "new" >"$GIT_DIR/BISECT_TERMS" &&
> + echo "old" >>"$GIT_DIR/BISECT_TERMS"
> + fi
> + NAME_BAD="new"
> + NAME_GOOD="old" ;;...and here nearly in the same way.
So perhaps you could use a function like:
write_bisect_terms() {
if test ! -s "$GIT_DIR/BISECT_TERMS"
then
echo "$NAME_BAD" >"$GIT_DIR/BISECT_TERMS" &&
echo "$NAME_GOOD" >>"$GIT_DIR/BISECT_TERMS"
fi
}