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=-0.7 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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 80A4A1F4D7 for ; Tue, 21 Jun 2022 15:49:41 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=pobox.com header.i=@pobox.com header.b="KM4HO+Q9"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353123AbiFUPth (ORCPT ); Tue, 21 Jun 2022 11:49:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350791AbiFUPtd (ORCPT ); Tue, 21 Jun 2022 11:49:33 -0400 Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03A052CE17 for ; Tue, 21 Jun 2022 08:49:31 -0700 (PDT) Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 474CB198094; Tue, 21 Jun 2022 11:49:31 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=HZgcD4/4FjRngpQsg/YzvdOHpmpzURs2OMnas3 3zgPE=; b=KM4HO+Q9kR+rW2KRlCKUchxEBttVrzPLBAzK+BPcFcA6t7/ChEZizO IMnh9os/F7lu84jnU08IbUbjcNB485r5b4KZGo+huieamoQUnKN6psPL3DFCFBbk KFq+8Jk2z+VbDmuouXuYLiAQ2i+TxriBJOrKq3C03jvWshu7MKFB8= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 40220198093; Tue, 21 Jun 2022 11:49:31 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.82.80.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id E1D06198091; Tue, 21 Jun 2022 11:49:27 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Johannes Schindelin Cc: Dennis van Gerwen , git@vger.kernel.org Subject: Re: Feature Request: Custom split location for `git add --patch` References: Date: Tue, 21 Jun 2022 08:49:26 -0700 In-Reply-To: (Johannes Schindelin's message of "Sat, 18 Jun 2022 15:01:06 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: BB6C71DA-F179-11EC-A2A4-CBA7845BAAA9-77302942!pb-smtp21.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Johannes Schindelin writes: > Hi Dennis, > > On Thu, 16 Jun 2022, Dennis van Gerwen wrote: > > ... > Note how the `-` line became a context line? It _has_ to be, otherwise the > second hunk could not be applied as-is. That is, until the first hunk has > been applied. In which case the second hunk needs to be modified: > > -- snip -- > @@ > All journeys start with a first step. > > +Actually, some journeys, some interesting ones, end in a disaster > +right at the start, because the first step was skipped. > > And this concludes the chapter. Good night. > -- snap -- > > Now the `[tbd]` line in the context has vanished. > > This is really an important concept to keep in mind: if you split at > context lines, your hunks can remain immutable. If you want to split > elsewhere, after one of the hunks resulting from said split is a applied, > you have to recompute the other hunk. Good write-up.