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: Sun, 8 Aug 2021 04:21:22 +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> 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="6591"; 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: emacs-devel@gnu.org To: Juri Linkov , =?UTF-8?Q?=c3=93scar_Fuentes?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 08 03:22:26 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 1mCXWE-0001T0-10 for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Aug 2021 03:22:26 +0200 Original-Received: from localhost ([::1]:58664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCXW8-0004HU-FB for ged-emacs-devel@m.gmane-mx.org; Sat, 07 Aug 2021 21:22:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCXVJ-0003b8-U8 for emacs-devel@gnu.org; Sat, 07 Aug 2021 21:21:30 -0400 Original-Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:51106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCXVH-0001Cn-1c for emacs-devel@gnu.org; Sat, 07 Aug 2021 21:21:29 -0400 Original-Received: by mail-wm1-x32d.google.com with SMTP id o11so1947981wms.0 for ; Sat, 07 Aug 2021 18:21:25 -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=LacOKKGI1TqQzya9emJ2cVTNjvLzA2g30cfGoqXOZb8=; b=ezhO6LC7c4jY81k2VgqlkrTAo33awydcd2LZ3cm2AiECrsqTE9c0UuxFSNDmigXXp3 zvzmpz3tU6Y/Y+w4qHWOuoDmff8O0ON4MEV78bUYwXHalA7R0hUxILP7LTM2B/r8gQrI LcHizZc1EOJFfBdkBr9O2MhP0jRgNsACSc8kFQfmFYBVCmWfsA4l6XmDwbKhERDacHY9 LvFX//u5BH15QNV64NoBkKFFdch1AewejyPlsGx4gKD/MuH9RA7tF3c/qlHvYH9LOZdL um+y9DSKUtlCe/1RZ9jR1KIkRfiuN0y7ZmKVi8CxsFaWVi7GapotxJzCR1ecNxm1Ezko ZAvA== 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=LacOKKGI1TqQzya9emJ2cVTNjvLzA2g30cfGoqXOZb8=; b=lLAAzxVhZQAj0dVN6LVUgwkBhgikH5rkaJsiDCz6LtqFxvThM2X71xApFzqO6RTDoV lrvjP1SXfsJiQ4OL6YfmbQni4tFvNFqCQdZ2rhvGJCCwy6nwoONToh0P/oK5RSiVGz9H Ii9MVIDCNV1fpkjvONuHg8g4jYj2mGFGQ3bdhTXE8rlEtdRcQFoKqJK3NRiYS5HlLAus ynqaQY8Ec4vBmJouYN/r16agIXLZtJY3HfhtV3jzHEaOVmUnM68zRsV0Xn0HtMthZFLv 7XJXQ1MHj/NqqG2R/W+GZUwWRMYxRZCuHutsFBtTLr+1h092Gt+jTerhNrZcgMpHaXKq mFUg== X-Gm-Message-State: AOAM532lbjK1vOK72/RBsHcqmSgi2hRgRQWFxJO2qNfIm3ZVNexBlmaR LI0rmfdfZbR98rb00+3OIosCWG5iAV8= X-Google-Smtp-Source: ABdhPJzg3l8xBtV+oa4p+CDRlEcHejyzGmCMimESrtlFcqZUWCQGKdtjEARsPOvpLy1kaXxbbcse4w== X-Received: by 2002:a1c:1d13:: with SMTP id d19mr27566861wmd.0.1628385684312; Sat, 07 Aug 2021 18:21:24 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id d15sm14200294wrn.28.2021.08.07.18.21.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Aug 2021 18:21:23 -0700 (PDT) In-Reply-To: <877dgzebux.fsf@mail.linkov.net> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32d.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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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:272186 Archived-At: Hi Juri, On 06.08.2021 02:20, Juri Linkov wrote: > While I think Magit is a great package for discoverability etc. > I found that it's completely sufficient to use just the shell-command. > With the persistent history of the previously constructed git commands > using a flex-style completion on previous commands will even reduce > the need in some vc commands, e.g. > > 'M-! chm TAB' runs `git checkout master` (instead of C-x v r) > 'M-! pur TAB' runs `git pull --rebase` (instead of C-x v P) > ... Same here (except for the flex completion). > Currently I'm finishing implementation of a new vc command that > will allow committing from a diff buffer. So for example, after > displaying all changes with e.g. 'C-x v D' you can remove > some unneeded hunks (with e.g. 'M-k' 'diff-hunk-kill'), > then on the remaining hunks type 'C-c C-c' in the diff buffer. > It will create a usual *vc-log* buffer where typing 'C-c C-c' > will commit only changes from the diff buffer. This is a very welcome development. > Internally > it works by running three git commands: > > `git stash push -m stash_name -- list_of_file_names_from_diff` > `cat diff_buffer.patch | git am` # should also handle return code Somewhere around here, I suppose you will pop up the usual log-edit buffer? > `git stash pop -q` For your consideration, here's a description of the strategy used by the venerable commit-patch command/package: https://github.com/caldwell/commit-patch/blob/master/commit-patch#L212-L214 - Let the user edit a diff in the diff-mode buffer - Save it to a file - 'git apply --cached', to put the contents to the staging area - 'git commit' It might have some advantages, such as less chance of something going awry with the user's stashes due to a coding error (current, or one possibly introduced in the future). On the flip side, I suppose it will be harder to reuse the existing 'checkin' backend function. Or generalize the exact approach to other backends, since only Git has staging area.