git-rev-range
TypeScript icon, indicating that this package has built-in type declarations

1.1.36 • Public • Published

git-rev-range

npm install git-rev-range

index.d.ts

demo

import * as path from 'path';
import { resolveRevision, revisionRange } from 'git-rev-range';

let cwd = path.resolve('../../../test/demo/git1');

let a: ReturnType<typeof resolveRevision>;

a = resolveRevision(5, null, {
	cwd,
});

console.log(a);
console.log(revisionRange(a.from, a.to, cwd));

a = resolveRevision(5, null, {
	cwd,
	realHash: true,
});

console.log(a);
console.log(revisionRange(a.from, a.to, cwd));

a = resolveRevision(5, null, {
	cwd,
	realHash: true,
	fullHash: true,
});

console.log(a);
console.log(revisionRange(a.from, a.to, cwd));
{ from: 'HEAD~3', to: 'HEAD', fromName: 'HEAD~3', toName: 'HEAD' }
HEAD~3..HEAD
{ from: '8bd0750',
  to: 'a9c9302',
  fromName: 'HEAD~3',
  toName: 'HEAD' }
8bd0750..a9c9302
{ from: '8bd07503d77f13c13dac408ce30ab46aa0ef8021',
  to: 'a9c93026130d18c12adfe547436c934ab685ff71',
  fromName: 'HEAD~3',
  toName: 'HEAD' }
8bd07503d77f13c13dac408ce30ab46aa0ef8021..a9c93026130d18c12adfe547436c934ab685ff71

Package Sidebar

Install

npm i git-rev-range

Weekly Downloads

10

Version

1.1.36

License

ISC

Unpacked Size

22 kB

Total Files

6

Last publish

Collaborators

  • bluelovers