From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#52349: 29.0.50; vc-git and diff-mode: stage hunks Date: Sun, 02 Oct 2022 21:51:19 +0300 Organization: LINKOV.NET Message-ID: <86zgeeysg4.fsf@mail.linkov.net> References: <268cee0d-465d-b862-d1d6-f5da4d69e737@inventati.org> <86fsr3uen2.fsf@mail.linkov.net> <95d2d999-49ad-13c4-9f25-0935650a1e42@yandex.ru> <8635ktjfll.fsf@mail.linkov.net> <36b963e4-5af7-dd9e-af92-4404541b9f4d@yandex.ru> <86v8xjx45h.fsf@mail.linkov.net> <861qt9h1hh.fsf@mail.linkov.net> <864jy1mrk8.fsf@mail.linkov.net> <86fsh1ll5y.fsf@mail.linkov.net> <87edwlo52t.fsf@melete.silentflame.com> <868rmqypjz.fsf@mail.linkov.net> <70b6d879-ea34-a473-aa27-7fc7b72fd7d0@yandex.ru> <86mtb4tpz6.fsf@mail.linkov.net> <78b1100c-89a6-5daf-548f-778807105307@yandex.ru> <86leqf6bwl.fsf@mail.linkov.net> <7af82b9a-212f-9456-dd28-7279f87e92c8@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="674"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 52349@debbugs.gnu.org, Sean Whitton To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 02 20:57:07 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1of49D-000AYG-8T for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Oct 2022 20:57:07 +0200 Original-Received: from localhost ([::1]:49536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1of49B-0007YM-20 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Oct 2022 14:57:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of44I-0001tW-7B for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 14:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1of44H-0000xo-US for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 14:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1of44H-0000bW-LX for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 14:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Oct 2022 18:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52349 X-GNU-PR-Package: emacs Original-Received: via spool by 52349-submit@debbugs.gnu.org id=B52349.16647367002295 (code B ref 52349); Sun, 02 Oct 2022 18:52:01 +0000 Original-Received: (at 52349) by debbugs.gnu.org; 2 Oct 2022 18:51:40 +0000 Original-Received: from localhost ([127.0.0.1]:48055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of43w-0000aw-5a for submit@debbugs.gnu.org; Sun, 02 Oct 2022 14:51:40 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:43361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of43u-0000ad-8v for 52349@debbugs.gnu.org; Sun, 02 Oct 2022 14:51:38 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id A5C0220002; Sun, 2 Oct 2022 18:51:28 +0000 (UTC) In-Reply-To: <7af82b9a-212f-9456-dd28-7279f87e92c8@yandex.ru> (Dmitry Gutov's message of "Mon, 19 Sep 2022 15:57:17 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244253 Archived-At: > It doesn't seem like it's going to differentiate between "add whole file" > chunks and any other kinds of chunks. > > Which is not a bad thing by itself, probably. But can increase the odds of > something like the above happening. I added more checks to detect the whole files boundaries, and pushed. >>>>> It's complex logic, so if you manage to write a test as well, that would be >>>>> excellent. >>>> A test could written when someone will create infrastructure for testing >>>> git commands with helpers to create a git repository and checking its content. >>> >>> test/lisp/vc/vc-tests.el actually contains a helper like this. >>> >>> Every scenario starts with calling vc-test--create-repo-function, and there >>> are tests for 'version-diff' at the very end of the file. It's somewhat >>> convoluted, so I don't blame you for missing it. >> Actually, I looked into test/lisp/vc/vc-git-tests.el that is almost >> empty. >> I expected that since this check is git-specific, it should be in >> vc-git-tests.el. > > Not sure how to best share the setup/teardown logic between vc-tests.el and > vc-git-test.el. I looked into this, but this is a too big task. It would be nice if Someone (TM) created the git-specific setup/teardown logic, and other helper functions in test/lisp/vc/vc-git-tests.el.