git-js icon indicating copy to clipboard operation
git-js copied to clipboard

Support for "git describe"

Open lghamie opened this issue 7 years ago • 3 comments

Will it be added?

Thanks!

lghamie avatar Oct 09 '18 19:10 lghamie

Hi, apologies for the slow reply. You can run this in the library at the moment using the .raw method eg:

const git = require('simple-git/promise');
const description = await git().raw(['describe', '--tags']);

I've added the v2 milestone, if you can fill out a bit more detail for how you'll be using it, I can have it added to that release.

steveukx avatar Oct 25 '18 16:10 steveukx

I'd also love to see support for git describe, in order to run git describe --tags like git.describe('--tags') in order to get any tag(s) which are associated with the current (latest) commit, if there are any.

I'm going to check out .raw as it looks like it will suit my needs for now.

paulshryock avatar Nov 14 '22 22:11 paulshryock

Actually, I was able to list tags associated with the latest commit using:

await git.tag(['--points-at', 'HEAD']

(And HEAD can be replaced with a commit hash.)

paulshryock avatar Nov 14 '22 22:11 paulshryock