Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
Bump version and compile
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoespeon committed Jan 9, 2017
1 parent 7752479 commit bc66516
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 62 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gitgraph.js",
"version": "1.8.0",
"version": "1.8.1",
"main": ["./build/gitgraph.js", "./build/gitgraph.css"],
"ignore": [
"**/.*"
Expand Down
21 changes: 13 additions & 8 deletions build/gitgraph.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ==========================================================
* GitGraph v1.8.0
* GitGraph v1.8.1
* https://github.com/nicoespeon/gitgraph.js
* ==========================================================
* Copyright (c) 2017 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶
Expand Down Expand Up @@ -530,8 +530,8 @@
this.offsetY = this.column * this.spacingY;

// Add start point
if (this.parentBranch) {
if (this.parentCommit === _getParentCommitFromBranch(this.parentBranch)) {
if (this.parentBranch && this.parentCommit) {
if (this.parentCommit === _getParentCommitFromBranch(this.parentBranch) && this.commits.length > 0) {
this.startPoint = {
x: this.parentBranch.offsetX - this.parent.commitOffsetX + this.template.commit.spacingX,
y: this.parentBranch.offsetY - this.parent.commitOffsetY + this.template.commit.spacingY,
Expand Down Expand Up @@ -722,8 +722,7 @@
var isFirstBranch = !(options.parentCommit instanceof Commit);
var isPathBeginning = this.path.length === 0;

options.showLabel = (isPathBeginning && this.showLabel) ? true : false;

options.showLabel = (isPathBeginning && this.showLabel);
if (options.showLabel) {
options.x -= this.template.commit.spacingX;
options.y -= this.template.commit.spacingY;
Expand Down Expand Up @@ -847,6 +846,12 @@
return this;
}

var firstBranchCommit = this.commits[0];
if (!firstBranchCommit) {
console.log(this.name + " is already up-to-date with " + targetBranch.name);
return this;
}

// Merge commit
var defaultMessage = "Merge branch `" + this.name + "` into `" + targetBranch.name + "`";
if (typeof commitOptions !== "object") {
Expand All @@ -859,9 +864,9 @@
commitOptions.type = "mergeCommit";
commitOptions.parentCommit = _getParentCommitFromBranch(this);

var branchParentCommit = this.commits[0].parentCommit;
var parentBranchLastCommit = _getLast(targetBranch.commits);
var isFastForwardPossible = (branchParentCommit.sha1 === parentBranchLastCommit.sha1);
var branchParentCommit = firstBranchCommit.parentCommit;
var targetBranchParentCommit = _getParentCommitFromBranch(targetBranch);
var isFastForwardPossible = (branchParentCommit && branchParentCommit.sha1 === targetBranchParentCommit.sha1);
if (commitOptions.fastForward && isFastForwardPossible) {
var isGraphHorizontal  = _isHorizontal(this.parent);
this.color = targetBranch.color;
Expand Down
4 changes: 2 additions & 2 deletions build/gitgraph.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/Branch.html
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line922">line 922</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line927">line 927</a>
</li></ul></dd>


Expand Down Expand Up @@ -665,7 +665,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line807">line 807</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line806">line 806</a>
</li></ul></dd>


Expand Down Expand Up @@ -939,7 +939,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line816">line 816</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line815">line 815</a>
</li></ul></dd>


Expand Down Expand Up @@ -1187,7 +1187,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line831">line 831</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line830">line 830</a>
</li></ul></dd>


Expand Down Expand Up @@ -1282,7 +1282,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line947">line 947</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line952">line 952</a>
</li></ul></dd>


Expand Down Expand Up @@ -1648,7 +1648,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line783">line 783</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line782">line 782</a>
</li></ul></dd>


Expand Down Expand Up @@ -1702,7 +1702,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Fri Jan 06 2017 09:25:20 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Jan 09 2017 23:31:47 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
8 changes: 4 additions & 4 deletions docs/Commit.html
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1021">line 1021</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1026">line 1026</a>
</li></ul></dd>


Expand Down Expand Up @@ -1425,7 +1425,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1168">line 1168</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1173">line 1173</a>
</li></ul></dd>


Expand Down Expand Up @@ -1497,7 +1497,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1069">line 1069</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1074">line 1074</a>
</li></ul></dd>


Expand Down Expand Up @@ -1544,7 +1544,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Fri Jan 06 2017 09:25:20 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Jan 09 2017 23:31:47 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/GitGraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Fri Jan 06 2017 09:25:20 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Jan 09 2017 23:31:47 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
4 changes: 2 additions & 2 deletions docs/Tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1256">line 1256</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1261">line 1261</a>
</li></ul></dd>


Expand Down Expand Up @@ -360,7 +360,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Fri Jan 06 2017 09:25:20 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Jan 09 2017 23:31:47 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
6 changes: 3 additions & 3 deletions docs/Template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1330">line 1330</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1335">line 1335</a>
</li></ul></dd>


Expand Down Expand Up @@ -1228,7 +1228,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1417">line 1417</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1422">line 1422</a>
</li></ul></dd>


Expand Down Expand Up @@ -1297,7 +1297,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Fri Jan 06 2017 09:25:20 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Jan 09 2017 23:31:47 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
21 changes: 13 additions & 8 deletions docs/gitgraph.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ <h1 class="page-title">Source: gitgraph.js</h1>
this.offsetY = this.column * this.spacingY;

// Add start point
if (this.parentBranch) {
if (this.parentCommit === _getParentCommitFromBranch(this.parentBranch)) {
if (this.parentBranch && this.parentCommit) {
if (this.parentCommit === _getParentCommitFromBranch(this.parentBranch) && this.commits.length > 0) {
this.startPoint = {
x: this.parentBranch.offsetX - this.parent.commitOffsetX + this.template.commit.spacingX,
y: this.parentBranch.offsetY - this.parent.commitOffsetY + this.template.commit.spacingY,
Expand Down Expand Up @@ -739,8 +739,7 @@ <h1 class="page-title">Source: gitgraph.js</h1>
var isFirstBranch = !(options.parentCommit instanceof Commit);
var isPathBeginning = this.path.length === 0;

options.showLabel = (isPathBeginning && this.showLabel) ? true : false;

options.showLabel = (isPathBeginning && this.showLabel);
if (options.showLabel) {
options.x -= this.template.commit.spacingX;
options.y -= this.template.commit.spacingY;
Expand Down Expand Up @@ -864,6 +863,12 @@ <h1 class="page-title">Source: gitgraph.js</h1>
return this;
}

var firstBranchCommit = this.commits[0];
if (!firstBranchCommit) {
console.log(this.name + " is already up-to-date with " + targetBranch.name);
return this;
}

// Merge commit
var defaultMessage = "Merge branch `" + this.name + "` into `" + targetBranch.name + "`";
if (typeof commitOptions !== "object") {
Expand All @@ -876,9 +881,9 @@ <h1 class="page-title">Source: gitgraph.js</h1>
commitOptions.type = "mergeCommit";
commitOptions.parentCommit = _getParentCommitFromBranch(this);

var branchParentCommit = this.commits[0].parentCommit;
var parentBranchLastCommit = _getLast(targetBranch.commits);
var isFastForwardPossible = (branchParentCommit.sha1 === parentBranchLastCommit.sha1);
var branchParentCommit = firstBranchCommit.parentCommit;
var targetBranchParentCommit = _getParentCommitFromBranch(targetBranch);
var isFastForwardPossible = (branchParentCommit && branchParentCommit.sha1 === targetBranchParentCommit.sha1);
if (commitOptions.fastForward && isFastForwardPossible) {
var isGraphHorizontal  = _isHorizontal(this.parent);
this.color = targetBranch.color;
Expand Down Expand Up @@ -1814,7 +1819,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Fri Jan 06 2017 09:25:20 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Jan 09 2017 23:31:47 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
28 changes: 14 additions & 14 deletions docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1500">line 1500</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1505">line 1505</a>
</li></ul></dd>


Expand Down Expand Up @@ -546,7 +546,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1564">line 1564</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1569">line 1569</a>
</li></ul></dd>


Expand Down Expand Up @@ -681,7 +681,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1531">line 1531</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1536">line 1536</a>
</li></ul></dd>


Expand Down Expand Up @@ -977,7 +977,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1581">line 1581</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1586">line 1586</a>
</li></ul></dd>


Expand Down Expand Up @@ -1184,7 +1184,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1617">line 1617</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1622">line 1622</a>
</li></ul></dd>


Expand Down Expand Up @@ -1301,7 +1301,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1542">line 1542</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1547">line 1547</a>
</li></ul></dd>


Expand Down Expand Up @@ -1436,7 +1436,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1484">line 1484</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1489">line 1489</a>
</li></ul></dd>


Expand Down Expand Up @@ -1571,7 +1571,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1514">line 1514</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1519">line 1519</a>
</li></ul></dd>


Expand Down Expand Up @@ -1707,7 +1707,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1646">line 1646</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1651">line 1651</a>
</li></ul></dd>


Expand Down Expand Up @@ -1842,7 +1842,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1684">line 1684</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1689">line 1689</a>
</li></ul></dd>


Expand Down Expand Up @@ -2001,7 +2001,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1708">line 1708</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1713">line 1713</a>
</li></ul></dd>


Expand Down Expand Up @@ -2142,7 +2142,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1695">line 1695</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1700">line 1700</a>
</li></ul></dd>


Expand Down Expand Up @@ -2277,7 +2277,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1673">line 1673</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1678">line 1678</a>
</li></ul></dd>


Expand Down Expand Up @@ -2626,7 +2626,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Fri Jan 06 2017 09:25:20 GMT+0100 (CET)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Jan 09 2017 23:31:47 GMT+0100 (CET)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit bc66516

Please sign in to comment.