Skip to content

Conversation

@mattyclarkson
Copy link
Collaborator

The following code doesn't work:

// Commit the bower.json file
.then(function() {
  return repository.createCommitOnHead(['bower.json'], identity, identity, 'release ' + version);
})

// Tag the new commit
.then(function(oid) {
  return nodegit.Commit.lookup(repository, oid);
})
.then(function(commit) {
  return nodegit.Tag.create(null, repository, version, commit, identity, 'version ' + version, 0);
})

This is because the git_create_tag needs to have the following descriptor:

"git_tag_create": {
  "isAsync": true,
  "args": {
    "oid": {
    "isReturn": true,
    "isSelf": false,
    "shouldAlloc": true
  },
  "return": {
    "cppClassName": "Number",
    "jsClassName": "Number",
    "isErrorCode": true
  }
},

@johnhaley81 johnhaley81 added this to the 0.3.0 milestone Feb 26, 2015
@maxkorp
Copy link
Collaborator

maxkorp commented Feb 26, 2015

A note, should be able to skip the args/return with the isAsync set, at least, i'd try it without first, then add those if necessary.

@mattyclarkson
Copy link
Collaborator Author

Ow. it failed tests 😢 will look through the logs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like that this test bundles both the creation and deletion together into a single test but if the tag isn't cleaned up the tests aren't repeatable.

@johnhaley81
Copy link
Collaborator

Looks like it failed linting. Try running npm test to see the linter errors.

@mattyclarkson
Copy link
Collaborator Author

huh, the linting checks on appveyor are moaning about Promise being a bad name. but that is used across lots of the test files. Is that something I should fix up across all the files? Not sure why that didn't show up on my box.

@mattyclarkson
Copy link
Collaborator Author

Oh, I didn't run jshint lib test/tests examples lifecycleScripts

@tbranyen
Copy link
Member

Ah my mistake, can you force push a fix that doesn't use camelCase, it's all lower case per:

http://jshint.com/docs/options/#futurehostile

@mattyclarkson mattyclarkson force-pushed the master branch 2 times, most recently from 90725d0 to d7c9e04 Compare February 27, 2015 19:26
@mattyclarkson
Copy link
Collaborator Author

Yay! 😃

@johnhaley81
Copy link
Collaborator

👍

The `git_tag_create*` functions expect there to be a Oid pointer as the
first parameter.
I'm not sure of how this should be handled at the moment. It will need
a similar descriptor as `git_tag_create` but maybe extra data defining
`buffer`.
A good convenience function for deleting a tag
This allows a user to easily create an annotated tag in a repository:

```
repository.createTag(oid, '0.0.0', 'version 0.0.0')
  .then(function(tag) {
    // The new tag is returned
  });
```
This allows new tags to be created and tested
This is a simple function that can create a new lightweight tag in a
repository. The same can be acheived by creating a new reference in
`/refs/tags/` but this performs libgit2 validation of tag names.

```
return repository.createLightweightTag(oid, 'foobar')
  .then(function(tag) {
    // The new tag is returned
  });
```
This flag fixes up the fact that we are polyfilling `Promise`:

```
var Promise = require('nodegit-promise');
```
@johnhaley81
Copy link
Collaborator

Manually merging this

@johnhaley81
Copy link
Collaborator

Manually merged via 094f240

@maxkorp
Copy link
Collaborator

maxkorp commented Feb 27, 2015

Awesome work @mattyclarkson

@mattyclarkson
Copy link
Collaborator Author

@johnhaley81, sorry I didn't merge this on friday the build failed on appveyor and I had to leave for a weekend away! Thanks for merging it in manually.

@johnhaley81
Copy link
Collaborator

No worries :)

On Mon, Mar 2, 2015, 2:23 AM Matt Clarkson notifications@github.com wrote:

@johnhaley81 https://github.com/johnhaley81, sorry I didn't merge this
on friday the build failed on appveyor and I had to leave for a weekend
away! Thanks for merging it in manually.


Reply to this email directly or view it on GitHub
#430 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants