all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Sean Whitton <spwhitton@spwhitton.name>
Cc: 60126-done@debbugs.gnu.org, juri@linkov.net
Subject: bug#60126: 30.0.50; vc-git-checkin: Offer to unstage conflicting changes
Date: Sat, 24 Dec 2022 16:50:55 +0200	[thread overview]
Message-ID: <bd90d48a-c3db-ac85-1034-4687363259e2@yandex.ru> (raw)
In-Reply-To: <8735958spl.fsf@melete.silentflame.com>

On 24/12/2022 04:02, Sean Whitton wrote:
> Hello,
> 
> On Sat 24 Dec 2022 at 01:18AM +02, Dmitry Gutov wrote:
> 
>> On 23/12/2022 05:59, Sean Whitton wrote:
>>> It works, except that sometimes the let-binding of process-environment
>>> fails, such that the commands affect the normal index rather than the
>>> temporary index.  Can you see what I'm doing wrong there?
>> Could you describe be "sometimes" occurrences? Does that happen through
>> repeating a similar action several times? Or slightly different actions?
>>
>> The process-environment setup seems fine. We did corrupt it in 1-2 places in
>> the past using 'setenv', but I don't see anything like that in the current
>> codebase. And the effect would probably be different anyway.
> Thank you for looking.  Slightly embarassingly, I can't reproduce the
> problem today.  So I've gone ahead and pushed.

Thanks!

> I am pretty happy with this approach, in the end.  Compared with other
> possible uses of 'git stash', it's quite clean:
> 
> - it doesn't touch the worktree copies of the files not involved in the
>    commit
> 
> - it stashes a single diff, rather than two diffs (one for the worktree
>    and one for the index), which is less for the user to deal with if
>    manual recovery becomes required.

It does indeed feel like we ended up in a good place. The code was 
pretty complex, though, and got more so.

We don't have tests covering vc-git-checkin-patch at all. Any chance 
you'll fancy working on adding those? Even if you only cover the 
scenarios where the user doesn't get prompted at all (either there's 
nothing staged, or the staged contents match the committed patch).

Writing (and debugging) a test could also help sort out fiddly 
behaviors, like the one you may have seen yesterday.

We have a default implementation for checkin-patch, so adding generic 
test for all major backends could work (in vc-tests.el). One or two 
extra tests could be also predicated on (eq backend 'Git), so that we 
don't yet need to copy the repository setup/teardown code to vc-git.el.





  reply	other threads:[~2022-12-24 14:50 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 18:32 bug#60126: 30.0.50; vc-git-checkin: Offer to unstage conflicting changes Sean Whitton
2022-12-17 17:06 ` Juri Linkov
2022-12-18  0:20   ` Sean Whitton
2022-12-18  1:08 ` Dmitry Gutov
2022-12-19 22:30   ` Sean Whitton
2022-12-20  0:53     ` Dmitry Gutov
2022-12-20  6:43       ` Sean Whitton
2022-12-20 13:47         ` Dmitry Gutov
2022-12-20 16:47           ` Sean Whitton
2022-12-20 15:13         ` Dmitry Gutov
2022-12-20 17:04           ` Sean Whitton
2022-12-20 23:10             ` Sean Whitton
2022-12-20 23:41               ` Sean Whitton
2022-12-20 23:45               ` Dmitry Gutov
2022-12-23  0:12                 ` Sean Whitton
2022-12-23  3:59                   ` Sean Whitton
2022-12-23  8:16                     ` Eli Zaretskii
2022-12-24  2:03                       ` Sean Whitton
2022-12-23 23:18                     ` Dmitry Gutov
2022-12-24  2:02                       ` Sean Whitton
2022-12-24 14:50                         ` Dmitry Gutov [this message]
2022-12-24 18:22                           ` Sean Whitton
2022-12-24 19:26                             ` Dmitry Gutov
2022-12-24 20:10                               ` Sean Whitton
2022-12-23 22:55                   ` Dmitry Gutov
2022-12-20 17:13           ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bd90d48a-c3db-ac85-1034-4687363259e2@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=60126-done@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.