Re: [PATCH v8 4/7] bisect: introduce --no-checkout, --update-ref=<ref> support into porcelain.
- From
Jon Seymour <jon.seymour@gmail.com>
- Date
- Jul 31, 2011, 19:40 UTC
- Message-ID
- <CAH3AnrqasW=ZSix0YBgxHg8ca2X+YOvSWknbG2mjsy0NaqV+Mw@mail.gmail.com>
- In-Reply-To
- <CAP8UFD2vCGnejSj=Nwkb+kGCpwUaggh5j2V6zBu0iWqNZwvS3Q@mail.gmail.com>
On Mon, Aug 1, 2011 at 5:21 AM, Christian Couder <christian.couder@gmail.com> wrote:
Show 10 quoted lines
> On Sun, Jul 31, 2011 at 1:55 PM, Jon Seymour <jon.seymour@gmail.com> wrote: >> >> + if test -n "$BISECT_UPDATE_REF"; then >> + eval="$eval echo '$BISECT_UPDATE_REF' > '$GIT_DIR/BISECT_UPDATE_REF';" >> + fi > > I don't like this very much. In fact I realize that the eval thing we > use is buggy because the result of 'eval "eval"' will be the result of > the last command in "eval", so we won't detect if one of the first > command in "eval" failed.
How about I fix the eval stitching so that it uses && rather than ; to connect each statement with a final true at the end so there is no dangling &&?
Show 8 quoted lines
> > So perhaps something like: > > eval "$eval" && > + ( test -n "$BISECT_UPDATE_REF" || echo "$BISECT_UPDATE_REF" > > "$GIT_DIR/BISECT_UPDATE_REF" ) && > echo "git bisect start$orig_args" >>"$GIT_DIR/BISECT_LOG" || exit >
Probably this would be better :-)
( test -z "$BISECT_UPDATE_REF" || echo "$BISECT_UPDATE_REF" > "$GIT_DIR/BISECT_UPDATE_REF" ) &&
jon.