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.bugs Subject: bug#52349: 29.0.50; vc-git and diff-mode: stage hunks Date: Fri, 4 Nov 2022 03:32:53 +0200 Message-ID: <713b060a-e32c-1a0a-fdb5-fa6a5a5d9af8@yandex.ru> 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> <86zgeeysg4.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="7023"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Cc: 52349@debbugs.gnu.org, Sean Whitton To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 04 02:51:36 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 1oqlrr-0001gX-Pt for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Nov 2022 02:51:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqlrk-0007OH-T1; Thu, 03 Nov 2022 21:51:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqlas-0004IO-PE for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 21:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqlas-000687-Gz for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 21:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqlas-00063k-CN for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 21:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Nov 2022 01:34:02 +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.166752558423145 (code B ref 52349); Fri, 04 Nov 2022 01:34:02 +0000 Original-Received: (at 52349) by debbugs.gnu.org; 4 Nov 2022 01:33:04 +0000 Original-Received: from localhost ([127.0.0.1]:51091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqlZw-00061E-FO for submit@debbugs.gnu.org; Thu, 03 Nov 2022 21:33:04 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:33529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqlZs-00060L-Sx for 52349@debbugs.gnu.org; Thu, 03 Nov 2022 21:33:03 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id h9so5189037wrt.0 for <52349@debbugs.gnu.org>; Thu, 03 Nov 2022 18:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:sender :from:to:cc:subject:date:message-id:reply-to; bh=PQafsFHvuEkH2XluGW3VoQt07Vdlcn9NeEcRXoWKmUY=; b=IK8OfP8XRp37TJ5wwYl1GXEX7jN5Sf77AbqdgoqKo1HlPeASE2CBE6/udLWx3WLKCZ TXROViirBRGZtuGxh/aW1fZNR65qIDwBY63Mqj1c0Wu707ujCqh1txCtEI7h+t4sjz3w /ZRsyl8ADlulIrJlKF9Da3pGXbhnzLg/AmfZV7Up4pbnq9HY1BXsVZrkDghysrA8gCF6 xgFLzrMOtDoozGicDJ0lp+0zYQ+4B1J+753G8XLlD4K1mfNBQe/SEmEXvR9bmptjp8FV ZW3JsNjgIeGw2AR5rTMAM+i0XgGuoh4BBJz14OkypRg+BbjCLSRwFIetPWhZJY5mCvV0 eUAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PQafsFHvuEkH2XluGW3VoQt07Vdlcn9NeEcRXoWKmUY=; b=Mmjx8z8WAY+UJmAsADYfGKB3HJ26QrGo/iobUycYaAuhecWw+UAMwTJSwEaZOZyn9T v/8KGzJJ8Uk4LhIbrMo0zq4Uv4eqQWiZkYbujR2Huc11Sgqtu6ftIuJ96vEDvpSuj4+L sQYT95KqDdZhAa4U9wCYjfjzAeHNItxAj5mhIVlM3JIjyB0AnVfg4IUGV/CXlJR7MGot 9RwViHSX5iZHaIt39WMwhkU/7u6r1XsXYTaTzkbDLdDGKSLQm+YYe4ba+Jf694Jal6Yd Z9f0Jbvz9y1PfbW1SM3E58YsSkJZam44uBUrY8EG9HeH6YDG7JXF/Bb0qEE99RMcUOlK sokg== X-Gm-Message-State: ACrzQf0uJunl1xEyuaKzq5f3BLpZ7MueWQ0aLH05PFRpbDqaWsDMNWsf JEZlWtTY/MJgJdYP+rJBX4U= X-Google-Smtp-Source: AMsMyM45uOkkViiDGfuhgSz0ssFhIVhPIUdFFnOoAr31T8l8tVTnwCpiNCppVvGQK28A1OI+Gp2TTQ== X-Received: by 2002:a5d:58f1:0:b0:236:b588:1e07 with SMTP id f17-20020a5d58f1000000b00236b5881e07mr19673007wrd.612.1667525575274; Thu, 03 Nov 2022 18:32:55 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f63-20020a1c3842000000b003cf4d99fd2asm1389364wma.6.2022.11.03.18.32.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Nov 2022 18:32:55 -0700 (PDT) Content-Language: en-US In-Reply-To: <86zgeeysg4.fsf@mail.linkov.net> 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247033 Archived-At: (Sorry, resending after unarchiving). On 02.10.2022 21:51, Juri Linkov wrote: >> 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. Thanks. >>>>>> 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. FWIW, now that the feature is supported across backends, we can add a corresponding test in vc-tests.el. ;-) Some backends will probably need to be skipped anyway, but the most popular ones will hopefully work.