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

Some questions about git-name-rev

From
David Kastrup <dak@gnu.org>
Date
Jul 16, 2007, 08:20 UTC
Message-ID
<86abtwyd2u.fsf@lola.quinscape.zz>

Hi, I am working on git support in Emacs. This involves putting version labels into the mode line and using them for specifying revisions to diff.

40 digit commit numbers are not really fun for that.

So I need to use git-name-rev. If I call it with the option --tags, it might return an empty string.

If I don't call it with --tags, _and_ the commit number I feed into it is the output of some git-rev-list, am I _guaranteed_ to become some output?

Now is there a way to _abbreviate_ the output to the shortest _valid_ form, namely not have something like ref/remote/heads/branchname (or similar) when branchname is sufficient?

-- 
David Kastrup
Message 1 of 1 in “Some questions about git-name-rev”
  1. David KastrupJul 16, 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.