git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
SOSergei Organov <osv@javad.com>
Date
Feb 8, 2008, 14:30 UTC
Message-ID
<87ve4zzfkl.fsf@osv.gnss.ru>
In-Reply-To
<87r6fporp3.fsf@wine.dyndns.org>
Alexandre Julliard <julliard@winehq.org> writes:
> Refuse to revert a file if it is modified in an existing buffer but
> not saved.

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.

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.

> On success, revert the buffers that contains the files that have been
> reverted.
This part is indeed very handy.
-- Sergei Organov.
Previous: Alexandre JulliardNext: Alexandre Julliard
Message 2 of 5 in “git.el: Check for existing buffers on revert.”
  1. 3/4 git.el: Check for existing buffers on revert.Alexandre Julliard, Feb 7, 2008
  2. Sergei OrganovFeb 8, 2008
  3. Alexandre JulliardFeb 8, 2008
  4. Sergei OrganovFeb 8, 2008
  5. Tommy ThornFeb 9, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.