From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id ADF121F51E for ; Sun, 25 Sep 2022 12:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbiIYMmw convert rfc822-to-8bit (ORCPT ); Sun, 25 Sep 2022 08:42:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbiIYMmu (ORCPT ); Sun, 25 Sep 2022 08:42:50 -0400 Received: from clausfischer.com (clausfischer.com [78.46.66.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 555B52F002 for ; Sun, 25 Sep 2022 05:42:49 -0700 (PDT) Received: from smtpclient.apple (host-79-16-150-161.retail.telecomitalia.it [79.16.150.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: claus.fischer@clausfischer.com) by clausfischer.com (Postfix) with ESMTPSA id C02D78A0463; Sun, 25 Sep 2022 14:42:46 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Subject: Re: Scriptable mode for git bisect From: Claus Fischer In-Reply-To: Date: Sun, 25 Sep 2022 14:42:43 +0200 Cc: Junio C Hamano , git@vger.kernel.org, Christian Couder Content-Transfer-Encoding: 8BIT Message-Id: References: <69B998A9-0E3E-45F0-8733-F2A3F11625A5@clausfischer.com> To: =?utf-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Mailer: Apple Mail (2.3693.60.0.1.1) Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Oh thank you, I didn’t know that / didn’t grasp that while reading (apparently too fast) your previous mails. That is way nicer. Thank you. Claus > On 25.09.2022, at 02:59, Đoàn Trần Công Danh wrote: > > On 2022-09-25 01:46:13+0200, Claus Fischer wrote: >> Well since I usually don’t have many revisions backwards, typically >> no more than 50, I can just traverse the tree backwards from main. >> I remember the last ‘bad’ revision before the good one. >> So there’s a solution for me. >> >> Yes the bisect command puts the correct ‘first bad’ revision in its >> output but it’s surrounded by a large amount of useless text. It >> would be nice to have a ‘quiet’ flag that lets it output just the >> bad revision. Alternatively, that it ends by checking out just that >> bad revision before revert. >> >> My problem is solved by stepping backwards to HEAD~1 each time, but >> you might consider making bisect more scriptable. > > No, you don't need to parse "git bisect" output to get the "first bad" > revision. The "first bad" revision is stored in refs/bisect/bad. > > And you can take the "first bad" revision in a scriptable way with: > > FIRST_BAD=$(git rev-parse --verify refs/bisect/bad) > > Of course, after finishing bisecting. > > -- > Danh