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: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 8F56F1F5A2 for ; Fri, 7 Feb 2020 20:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgBGUOe (ORCPT ); Fri, 7 Feb 2020 15:14:34 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:56472 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbgBGUOe (ORCPT ); Fri, 7 Feb 2020 15:14:34 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 1DC6C4C505; Fri, 7 Feb 2020 15:14:32 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=6kPSs0eFGVKyLHqFfLD7RjtReKg=; b=grMzaL w2s2L/CYPkpdg4DdKVBRsW60lRkjT6Gury/KNwexjQXHwz+PY3dWHpQz5SvPN7UD cCWLflIGaHj5sxYZI0Tob4bM2iAubtdRpKkSAju6nytqE0V4G3Ur65eNRB8HFLII 9UncspcLUm4Nd3PqXYDdL1O1QsLi5gIiK1uMs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=jJNdBBkNJgJduCyqx17CBuC0+AhWPC4l CGoDiEES9dOwpa+4l2aWsvYBnLxiXLoQkBLfxv2nku9Mmnjefaz+PESKmpBgn1k2 L98z3fZM1o/OKB4qBzaDNcg8FE0+WVPrNnFxU8udFJGwqLP1SlWC1EWp5fw8Q2WU XtpJXNbBNGk= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 13C044C504; Fri, 7 Feb 2020 15:14:32 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.76.80.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 542B24C503; Fri, 7 Feb 2020 15:14:31 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: Eric Sunshine Cc: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , SZEDER =?utf-8?Q?G=C3=A1bor?= , Git List Subject: Re: [PATCH] branch: let '--edit-description' default to rebased branch during rebase References: <20200112121402.GH32750@szeder.dev> <20200124224113.GJ6837@szeder.dev> <20200131155228.GF10482@szeder.dev> <20200131161630.GG10482@szeder.dev> <20200207100247.GA1111@szeder.dev> Date: Fri, 07 Feb 2020 12:14:29 -0800 In-Reply-To: (Eric Sunshine's message of "Fri, 7 Feb 2020 14:29:11 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 7348951A-49E6-11EA-B7A5-D1361DBA3BAF-77302942!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Eric Sunshine writes: >> > > How about teaching "git branch --edit-description [HEAD]" notice >> > > when/if HEAD is detached and always error out, no matter what >> > > operation is in progress? >> >> What I meant by "no matter what is in progress" is not to special >> case "during rebase", either. > > That would defeat the original purpose[1] of this submission, I think. > As I understand it, the idea all along was to make this operation work > during a rebase. I know. But I do not think it is a good thing to begin with. While you are rebasing the branch X and get control back before rebase finishes, you are *not* on branch X. You are *preparing* a new version of the history leading to the tip of branch X, in the hope that once you are done, you would make that new version of the history the history of branch X. Until that happens, you are not on branch X. If you were on branch X, then "git checkout -m another-branch" followed by some other operations, and then finally coming back with "git checkout -m X" would work. But it would not, because you are not on branch X. After all, you may well say "git rebase --abort" before you are done. Would "edit description" you do in the middle be reverted if you did so? It is bad for the user to blur the distinction between "detached and not on X but preparing to update X" and "working on X to advance X", and I think the original patch that started the thread takes us in that direction. Thanks.