Re: [PATCH 3/4] git.el: Check for existing buffers on revert.

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

 



Sergei Organov <osv@xxxxxxxxx> writes:

> What's the point? What if I do want to have modified buffer and still
> revert the on-disk file? Why git-revert cares to the level of
> prohibiting this?
>
> Besides, it's inconsistent with the rest of Emacs, I think, as in
> similar situations Emacs usually allows to either save the buffer(s), do
> not save the buffer(s) and continue, or abort operation (I suppose using
> (save-some-buffers) call, though I didn't check). See, for example, how
> (compile) behaves when some of buffers are not saved.

It's modeled on the vc-revert behavior, but yes, it could also prompt
whether to discard changes; prompting to save doesn't make sense if you
are about to throw away the changes. I think reverting the file on disk
without changing the buffer is confusing: either you want to discard the
changes, and you want to discard the buffer changes too, or you want to
keep your changes, and reverting the file on disk doesn't make sense
since the revert will be undone as soon as you save the buffer.

> In fact I believe the way PCL-CVS handles this, and that was implemented
> in my earlier patch, is superior compared to this patch. An addition of
> save-some-buffers call won't hurt either, but IMHO is not very useful in
> the specific case of git-revert.
>
> BTW, what definitely lacks (save-some-buffers) call is git-commit, as it
> silently commits on-disk state of a file when corresponding buffer is
> modified.

This could certainly be done, though it would have to be smarter than
a simple (save-some-buffers), I find it very annoying when compile
prompts to save a bunch of unrelated files.

-- 
Alexandre Julliard
julliard@xxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux