[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 4803fba487 1/2: 'C-x v v' on a diff buffer commits it as a pa

From: Eli Zaretskii
Subject: Re: master 4803fba487 1/2: 'C-x v v' on a diff buffer commits it as a patch (bug#52349)
Date: Mon, 29 Aug 2022 22:31:44 +0300

> From: Tassilo Horn <tsdh@gnu.org>
> Cc: Dmitry Gutov <dgutov@yandex.ru>, larsi@gnus.org, juri@jurta.org,
>  emacs-devel@gnu.org
> Date: Mon, 29 Aug 2022 21:03:50 +0200
> I think the difference is that "git apply --cached foo.patch" exits
> non-zero if the index isn't empty and vc-git-checkin errors when it's
> not.  That ensures the commit will include only the changes in the patch
> and nothing else.
> I guess other VCS impls could just test if the checkout is completely
> unmodified and signal an error otherwise.

Either that, or compare the list of modified files with the list of
patched files produced by Patch.

> That would be a bit more restrictive but still useful.

Yes, indeed.

> >> Personally I hope we discover some popular extension to Mercurial
> >> which we'll be able to use in the same way as we do Git's index area
> >> here. And then say job well done and keep the less-popular and
> >> outdated backends unsupported.
> >
> > The index thing being the problem because Git needs to have the
> > changes in the index before you can commit?  Or is there any other
> > reason?
> I think the git benefit is that you can have a completely dirty checkout
> (hundreds of modified files) but the command will still work fine as
> long as you haven't staged other changes yet.

It is perfectly fine to have the Git implementation be more flexible
and convenient than with other VCSes, which don't support the same
granularity/precision.  It would still be much better than having no
implementation at all for the other VCSes.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]