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: On the adoption of transient.el Date: Fri, 13 Aug 2021 06:06:01 +0300 Message-ID: References: <877di4on3d.fsf@posteo.net> <87im1oy6mw.fsf@posteo.net> <87y29hihea.fsf@posteo.net> <87sfzonu6k.fsf@ucl.ac.uk> <878s1gqlop.fsf@gmail.com> <8735ronpo0.fsf@ucl.ac.uk> <83lf5gjgtp.fsf@gnu.org> <87eeb8gdbq.fsf@telefonica.net> <877dgzebux.fsf@mail.linkov.net> <87eeb2aq2z.fsf@mail.linkov.net> <77d47675-a981-e181-9327-47763cf59e19@yandex.ru> <87mtpoh69a.fsf@mail.linkov.net> 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="26239"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cc: =?UTF-8?Q?=c3=93scar_Fuentes?= , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 13 05:06:58 2021 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 1mENX6-0006XR-C7 for ged-emacs-devel@m.gmane-mx.org; Fri, 13 Aug 2021 05:06:56 +0200 Original-Received: from localhost ([::1]:40792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mENX4-0005jy-C9 for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Aug 2021 23:06:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mENWJ-00055G-ES for emacs-devel@gnu.org; Thu, 12 Aug 2021 23:06:07 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:42551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mENWH-0006N2-QA for emacs-devel@gnu.org; Thu, 12 Aug 2021 23:06:07 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id q11so11208556wrr.9 for ; Thu, 12 Aug 2021 20:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9fdIyr6SaXsFG0Tjs2fzxncUbGXclfvp0pfIDEk0LWk=; b=eoBAOaqHcDfwUkncbW6Vhgh1OruYgTbh28tVv+zXWnLza4pnFKvFGYWY8kqYWOGGND gTVuwcuSxu5/pMK/k/dv6o8MNNIgwvzKg1e33QX4zXqOuWkubnRRrGqb+gJgmbOt1Hnb ZfB45EJP0ml3yZ46bDgJ/Zc0WiAZFo284zk9RP4UvgPUMGkg240Ltvfz/fi7sog0WZZ8 aA+Bmy6QT8b87qlsI3Xtpc/2qzuomJayNnFdPaYTQAjOW6HNDqUvvCvW4jQzKbX2JF87 jNUHyngbL20AvrJFZsO+UA0AmKQ9HCTnwRJGIRbg+6SGBIkauf7F9oIBNEFFQovRpzKH zNRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9fdIyr6SaXsFG0Tjs2fzxncUbGXclfvp0pfIDEk0LWk=; b=VeYVJpcH1kSwPHQsblfx/jrBoYVOM5bWFcB1nrArjk8lSE92WDM2G8sekbFODo+1SZ 45Tfzd1gE268IgIsqj4Rd2iOORWfos7Uxk+DFgaa9/CmYKovnWmbji1QxF3q6Z3xma9Y YF0zBldZHSm+Kq2vb1V5GJdx8yv4ZnfKjDRR4UXABOHrM3XJTohnLd49fBRL3HCPqoAr fN6W9J1DdG5OW1KFYcTkCjT9I62+vvUHPo9/WNO6h5O/FLEJwaHkXyw56Ob5NdS/vIdU yc88GpGG9PZekRzJWa3Mjy7UczRhlfbChrhUnUV7Q4bppfx0+7PVMGMZwZBFwIbzVh2i sXKQ== X-Gm-Message-State: AOAM530XCLN93hi2Sobft+4E3Uu8wyZuQ1qKDKPYF/n3b7PtKAXm/vK9 7wflZ0H6zDkIkYQfJpkmxzhoyg7H0hE= X-Google-Smtp-Source: ABdhPJwi1gp9CDTvliMLb9o4tiuLixrJl31CewrIfxiTvaibpk/b/EmFRM0KNc8PPFH/7NYDB89OAg== X-Received: by 2002:a05:6000:1864:: with SMTP id d4mr381927wri.250.1628823963617; Thu, 12 Aug 2021 20:06:03 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id x13sm149031wrq.44.2021.08.12.20.06.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 20:06:02 -0700 (PDT) In-Reply-To: <87mtpoh69a.fsf@mail.linkov.net> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=raaahh@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, 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 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:272365 Archived-At: On 11.08.2021 09:58, Juri Linkov wrote: >> Sorry, I don't understand. Could you explain the scenario in more detail? > This is the shortest test case: > > 1. make changes in one part of a file > 2. create a patch with changes in another part of the same file > 3. git apply --cached a.patch > 4. git commit -m "Apply a.patch" > 5. git commit -a -m "Commit original file changes" > > The last commit reverts the changes committed from the patch. I see, thanks. To respond to that, I think even among those who would use this feature (advanced users), most aren't going to edit the diff outputted by 'C-x v D' aside from splitting and deleting hunks (available by bindings 'C-c C-s' and 'k'). And those kind of changes shouldn't trigger this problem. Second, if someone does edit the patch further (after switching off the read-only-mode in the diff buffer), they might actually expect this behavior: like, I edited the changes for commit, but I didn't edit the file itself; should the working copy of the file really incorporate those changes? And if they're using something like diff-hl-mode, they would notice the effect quickly (whether they expected it or not), and could undo/apply that missing change easily. There is a similar solution to stashes using 'git apply', but it seems finicky. Assuming a.patch changes file.ext: 6. git add file.ext 7. git apply --3way a.patch And see the conflict markers (if the changes do indeed conflict, which is not necessarily the case). I'm not sure triggering conflicts on commit is the best idea, but the "no conflict" situation seems nice. Either way, it requires a user with advanced skill. A simpler implementation that would require them to do an extra step manually in unusual scenarios doesn't seem too bad.