[Top][All Lists]

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

Re: git-handler.el

From: Michael Albinus
Subject: Re: git-handler.el
Date: Sun, 13 Aug 2017 11:26:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Jonas Bernoulli <address@hidden> writes:

Hi Jonas,

> So if you are visiting "/path/to/@@file/some-feature", it would be nice
> if `find-file' gave you "Find file: /path/to/@@file/" and you could type
> "ma TAB RET" to visit "/path/to/@@file/master".  But that's only one
> variant of "same file, another revision" and probably not even the most
> common one.

That shall work out-of-the-box, file-name-all-completions knows of branches.

> Another variant would be "same file, next/previous revision" where
> next/previous could have different meanings.  A common one is "the
> next/previous revision which touched this line".  Currently there's even
> exists a package just for that use case: `git-timemachine'.
> (Magit also provides that same feature but the implementations are not
> compatible.  `git-timemachine' reuses the same buffer to visit different
> version of the file (which has the benefit that no buffers have to be
> cleaned up later), while Magit uses a new buffer (which allows you to
> look at different versions of the same file at once).)

That's not possible with magic file name handler operations as they are
defined now. They don't give you the ability to say something about the
file contents.

> Anyway, I don't think it makes sense to teach `find-file' about going to
> the next/previous revision.  Instead that use-case should be handled by
> separate commands, which would likely be bound to "<some-prefix> n" and
> "<some-prefix> p" (that's what `git-timemachine' and Magit currently do).

I agree. New commands in dired would serve, indeed. But that would be
backend specific.

> The point I am trying to make here is that `find-file' cannot possibly
> the right command to handle all cases of "same file, another revision"
> with ease, while it is completely suitable for "same revision, another
> revision", with no extra effort.  But only if we go with the REV:PATH
> scheme.

Isn't my proposal what you have in mind? Both
/home/albinus/src/emacs/lisp@@/ef7a18a071/display-line-numbers.el and
/home/albinus/src/emacs@@/ef7a18a071/lisp/display-line-numbers.el would
point to the same revision ef7a18a071 of lisp/display-line-numbers.el.

Best regards, Michael.

reply via email to

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