From 9981e4b3bf055885d397e8218d80762b363fc791 Mon Sep 17 00:00:00 2001 From: "juanp.garcia" Date: Fri, 1 Jun 2018 14:42:31 -0300 Subject: [PATCH 1/4] fixes sub folder problem to find .gitmessage Co-authored-by: Juan Pablo Garcia Ripa Co-authored-by: Juan Pablo Garcia Ripa --- src/git.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git.js b/src/git.js index f2e7752..8b64aa9 100644 --- a/src/git.js +++ b/src/git.js @@ -86,7 +86,7 @@ function removeSection(section) { * @returns {string} Relative path to "$GIT_DIR/" */ function gitPath(path) { - return silentRun(`git rev-parse --git-path ${path}`).stdout.trim(); + return silentRun(`git rev-parse --show-cdup | tr -d '\n' && git rev-parse --git-path ${path}`).stdout.trim(); } /** From 5a910129fc3d90ce90df27543adcfa3c2ba59866 Mon Sep 17 00:00:00 2001 From: "juanp.garcia" Date: Mon, 4 Jun 2018 11:09:50 -0300 Subject: [PATCH 2/4] select git version for rev-parse Co-authored-by: Juan Pablo Garcia Ripa Co-authored-by: Juan Pablo Garcia Ripa --- bin/mob.js | 3 ++- src/git.js | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/mob.js b/bin/mob.js index 8d88faf..a3ec710 100755 --- a/bin/mob.js +++ b/bin/mob.js @@ -1,4 +1,5 @@ -#! /usr/bin/env node +#! /home/juanpablo/.nvm/versions/node/v8.11.2/bin/node --inspect-brk +//#! /usr/bin/env node const minimist = require('minimist'); const { oneLine } = require('common-tags'); diff --git a/src/git.js b/src/git.js index 8b64aa9..828f570 100644 --- a/src/git.js +++ b/src/git.js @@ -86,6 +86,13 @@ function removeSection(section) { * @returns {string} Relative path to "$GIT_DIR/" */ function gitPath(path) { + let version = silentRun('git --version').stdout.trim(); + let [,mayor,minor,patch] = /.*(\d)\.(\d*)\.(\d*)/gm.exec(version); + + if (mayor >= 2 && minor >= 13){ + return silentRun(` git rev-parse --git-path ${path}`).stdout.trim(); + } + return silentRun(`git rev-parse --show-cdup | tr -d '\n' && git rev-parse --git-path ${path}`).stdout.trim(); } From 98c66b82674a203e7b3d18b918079afeeda1d83d Mon Sep 17 00:00:00 2001 From: "juanp.garcia" Date: Mon, 4 Jun 2018 11:14:55 -0300 Subject: [PATCH 3/4] fixed env run Co-authored-by: Juan Pablo Garcia Ripa Co-authored-by: Juan Pablo Garcia Ripa --- bin/mob.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/mob.js b/bin/mob.js index a3ec710..8d88faf 100755 --- a/bin/mob.js +++ b/bin/mob.js @@ -1,5 +1,4 @@ -#! /home/juanpablo/.nvm/versions/node/v8.11.2/bin/node --inspect-brk -//#! /usr/bin/env node +#! /usr/bin/env node const minimist = require('minimist'); const { oneLine } = require('common-tags'); From b4a7344ca328395efd6614386915879f6b57aebc Mon Sep 17 00:00:00 2001 From: "juanp.garcia" Date: Mon, 4 Jun 2018 11:20:10 -0300 Subject: [PATCH 4/4] fixed lint issues Co-authored-by: Juan Pablo Garcia Ripa Co-authored-by: Juan Pablo Garcia Ripa --- src/git.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/git.js b/src/git.js index 828f570..e2851ed 100644 --- a/src/git.js +++ b/src/git.js @@ -86,10 +86,10 @@ function removeSection(section) { * @returns {string} Relative path to "$GIT_DIR/" */ function gitPath(path) { - let version = silentRun('git --version').stdout.trim(); - let [,mayor,minor,patch] = /.*(\d)\.(\d*)\.(\d*)/gm.exec(version); + const version = silentRun('git --version').stdout.trim(); + const [, mayor, minor] = /.*(\d)\.(\d*)\.(\d*)/gm.exec(version); - if (mayor >= 2 && minor >= 13){ + if (mayor >= 2 && minor >= 13) { return silentRun(` git rev-parse --git-path ${path}`).stdout.trim(); }