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

Getting version output for a file.

From
David Kastrup <dak@gnu.org>
Date
Jul 11, 2007, 11:39 UTC
Message-ID
<86abu3dv9o.fsf@lola.quinscape.zz>
Hi,

the Emacs support for git is incomplete, making it bomb out, for example, when doing C-u C-x v =

In order to have it work better, I need to fill in the following functions:

(vc-git-previous-version FILE REV) Return the version number immediately preceding REV for FILE, or nil if there is no previous version.

(vc-git-next-version FILE REV) Return the version number immediately following REV for FILE, or nil if there is no previous version.

REV will tend to be a symbolic reference like "master" or possibly "master{2}" (I am fuzzy about the details, but at least repeated invocations of vc-git-previous-version should work with the previous output). The corresponding next and previous versions should be changes that actually changed the file in question.

There is likely going to be some magic shell invocation of git-rev-list, git-symbolic-ref and/or similar things to achieve this task. I don't have enough of a clue to fill in the necessary details, but I'd be able to convert them into Elisp.

Anybody with good suggestions? It would be beneficial if this would not require the newest git version in order to work. If that means that the output needs to be somewhat more massaged, that's ok.

Thanks,
-- 
David Kastrup
Next: Brian Gernhardt
Message 1 of 3 in “Getting version output for a file.”
  1. David KastrupJul 11, 2007
  2. Brian GernhardtJul 11, 2007
  3. Add missing functions to contrib/emacs/vc-git.elDavid Kastrup, Jul 12, 2007

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.