From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: How to commit hunks using VC? Date: Sat, 27 Oct 2018 02:57:09 +0700 Message-ID: References: <87sh0s7say.fsf@example.com> <83tvl8obl4.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1540583758 1847 195.159.176.226 (26 Oct 2018 19:55:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2018 19:55:58 +0000 (UTC) Cc: help-gnu-emacs To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 26 21:55:54 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gG8D4-0000PY-BA for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Oct 2018 21:55:54 +0200 Original-Received: from localhost ([::1]:33996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG8FA-0000HB-Q9 for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Oct 2018 15:58:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG8Ef-0000Aj-OP for help-gnu-emacs@gnu.org; Fri, 26 Oct 2018 15:57:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG8Ed-0001tc-SY for help-gnu-emacs@gnu.org; Fri, 26 Oct 2018 15:57:32 -0400 Original-Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:36414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gG8Eb-0001rC-Ic for help-gnu-emacs@gnu.org; Fri, 26 Oct 2018 15:57:30 -0400 Original-Received: by mail-ot1-x32a.google.com with SMTP id x4so2193944otg.3 for ; Fri, 26 Oct 2018 12:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=HwzIrs11ngBetZxnivBuspQ47MkQMOkNPg6lcqS40pM=; b=LfZipQcOrbBeaX83JVoE43OEQ1VAPOHxWJ8gzJBuSYFF5YgH2K5DmZBAK4EENonUEI UaDPS0tMrjvQv8ZkSuPickhgsHL773HP/Rdn9KVpEXgnjoRROPcNMfuDSufIejP+4G4y A7oRp1SpNmyIaV2gmW0hWg350UVGPYri4h11Ks6hPi9ULWO3jIYaBj3y0yVZ7PD8vGI7 I8gU4cFNp+68I5z1bdRK5ZM5orIA04WAm4ZrMElRTpI47t6BkM4P+Cr+6bJflr4S33Vg P1zu4j4Zz7zeD6aOBCCc8+jCi+Q0f8eYQoxteUZ0VsiUhdGSKKkF+BPh7esADTufZJka j9Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=HwzIrs11ngBetZxnivBuspQ47MkQMOkNPg6lcqS40pM=; b=Z7ESZBeXVrxXaZUWgPzzZNLyRBrdg9OPx4opHLkZZ5Xki9EQ/iK806oCqTQASdh9bp JIb/ZI2PhnNH386bfG+ESIxSDMYP5GSOGrTQ8BBWdsxfUgGtTO1noFYZCQZynM6or+O4 QmiyirrMHIslP/dkDIWg7ezy8OYI9PCW2gFazzQjSS0alRMrf4D3yZ1CXtkuQKUwm+Q4 Qt/dpWYDve/e6I6WOr6BcaX/9O1yPQCDKpStolkddxBghvVysuRk6yBKB7nnWNcsNFiR d4In68YFSDTtmR0+atpTYf8zEmIoKSAJu/l3xTFbiaLyjPipFmeTqHFuQZKJAhWrouMa uuTg== X-Gm-Message-State: AGRZ1gI7Ya2qlnouoOWp4WRjeeICwYYRqFhLSYj9mTWj7Z+5Eg/Kulqf ckb0R602TT56+kRLlQBJ1RxuJw0X4VmHUd/AjyAigA== X-Google-Smtp-Source: AJdET5ezTSsvUT12ugbAd9kT/77dY7lougkQ6sYdh6TuvVUB+vJ9aEchJCqyjk8bpZ+b0hmcWCvm9gqxpQeF3i58LI8= X-Received: by 2002:a9d:17e9:: with SMTP id j96mr3250324otj.34.1540583841027; Fri, 26 Oct 2018 12:57:21 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32a X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118430 Archived-At: On Sat, Oct 27, 2018 at 2:47 AM Stefan Monnier w= rote: > > If I need to commit a change that is finer than a single line, I can > > press =E2=80=98RET=E2=80=99 on the relevant line in the diff, which tak= es me to the > > buffer of the file at point, with point on the corresponding line. I > > can edit the line, save the file, switch to the status buffer, stage > > the line, switch back to the file, and undo the changes so that I > > could put them in the next commit. > > Stash never enters the picture. > > Whether you use "do ... undo" as above, or "cp foo foo.bak ... cp > foo.bak foo" or "stash ... unstash" is up to you. To me these are just > minor variants of the same approach. Essentially, yes, but do/undo operates on line level, cp on file level, and stash/unstash on the whole working copy. Also, the situation where you have one version of the line on the branch, a different one in the working copy, and need to stage a third one that differs from both of the above, is rare.