tblobaum / git-rev Goto Github PK
View Code? Open in Web Editor NEWgit revision in node
License: MIT License
git revision in node
License: MIT License
As the author doesn't seem to be active anymore, I have used kulak-at
's fix from this PR #13 and published it as a new package here:
I currently use git-rev as follows:
process.chdir(__dirname)
git.short(function (str) {
// ...
})
But isn't the first line redundant? In the beginning of git-rev's index.js
file, there is this:
exec(cmd, { cwd: __dirname }, function (...) { ... })
So git-rev should automatically take care of changing the current working directory. However, if I simplify my code:
git.short(function (str) {
// ...
})
Then it doesn't work unless I already am in the correct directory.
When git commit contains " character throws error:
"Msg "xxx".",
^
SyntaxError: Unexpected token s
at Object.parse (native)
at /Users/xx/xx/xx/node_modules/git-rev/index.js:25:17
at /Users/xx/xx/xx/node_modules/git-rev/index.js:5:5
at ChildProcess.exithandler (child_process.js:646:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Socket.<anonymous> (child_process.js:969:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)```
Either that or I'm doing something wrong. No API is called with data in the functional parameter.
git.short (rev) ->
console.log rev #empty
it's ubuntu 12.04
bump version and publish to npm for latest goodness to be available.
Wrapping the exec call and ignoring errors is asking for trouble.
Build scripts are a main use case for this lib. Build scripts are often dumb and not optimized for async use.
tag(...) does not supply "The Tag" just the closest tag in the tree and supresses important information.
Using --abbrev=0 means that a commit that is 10 away from the latest tag will not show LATEST-TAG-10 but only LATEST-TAG
This is wrong - the command should be fixed or called latestTag(...)
Causing the following to occur:
co Ceppi" ],[ "81735deeacf3c050b1f73e8923f785cb6c5f5e2d", "Tweaked "messages""
^
SyntaxError: Unexpected token m
at Object.parse (native)
at module.exports.log (/home/marco/Projects/ondina/control-panel/node_modules/git-rev/index.js:25:17)
at /home/marco/Projects/ondina/control-panel/node_modules/git-rev/index.js:5:5
at ChildProcess.exithandler (child_process.js:538:7)
at ChildProcess.EventEmitter.emit (events.js:96:17)
at maybeClose (child_process.js:638:16)
at Socket.ChildProcess.spawn.stdin (child_process.js:815:11)
at Socket.EventEmitter.emit (events.js:93:17)
at Socket._destroy.destroyed (net.js:357:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Hi!
We have some commits with backslash in comments! cb(JSON.parse("["+ str +"]")) doesn't like these backslash....
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.