From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: master 4803fba487 1/2: 'C-x v v' on a diff buffer commits it as a patch (bug#52349) Date: Tue, 30 Aug 2022 16:52:10 +0300 Message-ID: <383e8f09-3c2c-2ac9-3aa8-074379f584a5@yandex.ru> References: <166171593185.16640.41619657947456727@vcs2.savannah.gnu.org> <20220828194533.23A6BC00889@vcs2.savannah.gnu.org> <87r10znm0y.fsf@gnus.org> <83fshfvvyn.fsf@gnu.org> <83bks3vtf5.fsf@gnu.org> <83tu5uug68.fsf@gnu.org> <834jxtvqb3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19268"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: larsi@gnus.org, juri@jurta.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 30 15:53:33 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT1gJ-0004mh-VL for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 15:53:31 +0200 Original-Received: from localhost ([::1]:48744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT1gJ-0001NN-1W for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 09:53:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT1fN-0008Tm-73 for emacs-devel@gnu.org; Tue, 30 Aug 2022 09:52:33 -0400 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:39855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oT1fL-0008Gb-8X; Tue, 30 Aug 2022 09:52:32 -0400 Original-Received: by mail-wr1-x429.google.com with SMTP id az27so14324132wrb.6; Tue, 30 Aug 2022 06:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc; bh=SPMPFGAw5bxltwvfA1EKSUh8xF5fH5GkKrZQCDrzC6c=; b=T7rw2ywyKbXtdrniP8lRIYKP/hBh0yE3OenhHSKoB1VUGIepVjKScczKj/1I2cXUxn zLPRIvcaPBzom1dTR+9GDuLueoy8WMiqxfAwP+VxmJ8TC2Z5LzVrEEcCr3N5+iv0vUyz HcSnCwAVlaYsK2BF9Cb2k0Ign5+PNOcQ0EHqGuxHUKbiHu5w460yYiE7IGv+Q5KmEqAa MKmKip4vEEvIrxihW0POnKibOd7UNL2f7vi/0IEOoyS2l8m71NAZ13YiR+MvnaGWKKkj LsRM5h97HoygYuTLX3Jw5xE/XOlAY6RUCf9MUfQ2pyRSKTbj/kqvR+U7aMo3m4oC1pMg U1UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc; bh=SPMPFGAw5bxltwvfA1EKSUh8xF5fH5GkKrZQCDrzC6c=; b=2iys9CT08vFEEgeG3RNAXSsTtMlAEMpgLg5ZOpoRnhYBsuIwX4KcRxJIKlxT5e9Jhb +b0StxW0Mv/rYsT53zWgCwq9PFA0KZOWyFvxf4gk6duLjmQiCmIbNcrayAQawEuS96L8 N8sKxq/kx0UHKAy8HYVZGaMTYfoDcxYstrJaMc8ItKY47N8mGeFq+BZzj0zhPsST5GXr RxQ7xpLayK28LWXtQdSFvNPTk8Ddskt9U3Gh5flTpli6PuY+tSsoExGfdRfu6tS9E4u4 8iOIU4kfiJMHN8HiBl63ucUzQyNngdqv7qCwB6AV/z5dVpmivCsQT705yAxFzQvuawcO bckA== X-Gm-Message-State: ACgBeo2fzDEw2HGXHgeFnOJu0TgA7TJC9TY0gF/DRWjtsorZ+QI85DKL 77NqTgBLBT3iplvfnHo55x/PJRkTkWY= X-Google-Smtp-Source: AA6agR7iPlWZR+KXiKxuUNmTX9OhvWRiPFe18Ic0OkPUC+uxpPnHWiYt6o25fQR1dL2c+L2leiziNA== X-Received: by 2002:a05:6000:50a:b0:225:210c:a7e4 with SMTP id a10-20020a056000050a00b00225210ca7e4mr8969829wrf.704.1661867532615; Tue, 30 Aug 2022 06:52:12 -0700 (PDT) Original-Received: from [192.168.0.215] (buscust41-118.static.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id a22-20020a05600c225600b003a3442f1229sm12763958wmm.29.2022.08.30.06.52.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Aug 2022 06:52:12 -0700 (PDT) Content-Language: en-US In-Reply-To: <834jxtvqb3.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=raaahh@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, GAPPY_SUBJECT=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294343 Archived-At: On 30.08.2022 16:01, Eli Zaretskii wrote: >> Date: Tue, 30 Aug 2022 15:35:31 +0300 >> Cc: larsi@gnus.org, juri@jurta.org, emacs-devel@gnu.org >> From: Dmitry Gutov >> >>>> Note that "the patch" will usually be a subset of the current 'git diff' >>>> output. But not always (the patch can be additionally modified by hand). >>> >>> I understand. But how is this significant? Doesn't "git apply" >>> require a valid patch as well? >> >> It's significant in that the starting conditions is that the files are >> already modified compared to the repository head, and the end goal is to >> be able to pick only some of those changes for commit. > > Ouch! Then this feature will be useless for me, and I'm sorry I > wasted everyone's time based on the description in NEWS, which doesn't > make a point of emphasizing this basic assumption. Perhaps we could make it more useful for you as well, e.g. by applying all the changes from the patch first when called with 'C-u'. I guess the problem is that the first step is not so easily automated: at least in my experience 'diff-apply-hunk' will either fail to find the files to patch (and prompt me to find them manually), or fail because of whitespace problems, or because it was made against some previous version of the code, and now has conflicts. And after I resolve all of this by hand, the files now have all the changes applied, and we're in the situation where 'C-x v D' followed by the new 'C-x v v' in diff-mode works just fine. But I suppose if your patches apply cleanly most of the time, it can be less of a problem. >> OTOH, the lack of support for workflow corresponding to 'git add -p' has >> been complained about frequently, it's one of the reasons people use >> Magit, and I felt it as well many times. > > I cannot agree that this feature is a reasonable solution for the > "git add -p" workflow. It is not interactive enough for that. It's... a more power-user approach to the same, with a different UI. Experience shows that this workflow can work as an alternative, evidenced by the userbase of the commit-patch package. diff-mode provides commands to delete hunks, split them, and even allows one to edit individual characters (something that 'git add -p' doesn't provide). So I'd argue this way might even be more powerful.