I would like to list the available tags in Magit in order to diff a specific revision, is this possible?

Specifically what I am after is to list the revision history at a certain tag and then view the diff for one of the patches in its history. I have just completed a rebase and noticed some inconsistencies, I know which patch introduced the change and I would like to see its diff from the version prior to the rebase.

  • 2
    Not a very robust way, but will work for the lack of better options: : tag - : will execute git with the given argument and git tag will just print the list of all tags. – wvxvw Jan 21 '15 at 8:54
up vote 11 down vote accepted

Specifically what I am after is to list the revision history at a certain tag

It sounds like you already know the tag you need, in which case:

Magit 1.x:
lrl type tag name (with TAB completion) RETRET

Magit 2.x:
lo type tag name (with TAB completion) RET

I have just completed a rebase and noticed some inconsistencies

Or use the reflog to find the pre-rebase hash:

Magit 1.x:
lrh

Magit 2.x:
lORET

I would like to list the available tags in Magit ...

Type y to show a buffer which lists branches, remote branches, and, at the bottom, tags.

...in order to diff a specific revision [reachable from that tag]

Move to the tag and press l o RET. That shows the log for that tag. Move to the commit and press RET. That shows information about that commit, including the diff.

You don't necessarily have to move to the tag first to show the log for it. You can also type l o<TAGNAME>RET.

  • The list of tags was too long and distracting for me too see every time I hit y, so I configured the magit-refs-sections-hook variable to take it out. Is there another way to explicitly list all the tags? – David Ongaro Oct 10 at 19:24
  • 1
    Instead of removing the tag section you can just configure it to be hidden by default, see magit-section-initial-visibility-alist. – tarsius Oct 10 at 21:50
  • Thanks, seems to work great (I added remote and tags to that list). Also nice that it remembers the last open/closed state. – David Ongaro Oct 11 at 1:12

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.