onigoetz / absorption

Calculate absorption on your repositories
https://www.npmjs.com/package/absorption
6 stars 1 forks source link

Scanning fails on accented filenames #5

Open SergioMendolia opened 4 years ago

SergioMendolia commented 4 years ago
Failed item in queue Error: Command failed with exit code 128: git blame --incremental 
fatal: pas de chemin "content/articles/vernissage-des-\303\251ditions-alphil.json" dans master
    at makeError (/usr/local/lib/node_modules/absorption/node_modules/execa/lib/error.js:58:11)
    at handlePromise (/usr/local/lib/node_modules/absorption/node_modules/execa/index.js:114:26)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async getBlame (/usr/local/lib/node_modules/absorption/src/git.js:66:3) {
  shortMessage: 'Command failed with exit code 128: git blame --incremental "content/articles/vernissage-des-\\303\\251ditions-alphil.json" master',
  command: 'git blame --incremental "content/articles/vernissage-des-\\303\\251ditions-alphil.json" master',
  exitCode: 128,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'fatal: pas de chemin "content/articles/vernissage-des-\\303\\251ditions-alphil.json" dans master',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

I know... nobody ever uses accents on filenames, but on static websites with user-generated content, this happens.

onigoetz commented 4 years ago

Hmm indeed, I’ll look into this as well. In the meantime you can set the accented file to have a weight of zero to ignore it and continue

onigoetz commented 3 years ago

Sorry it's been a long time, I'm trying to investigate this. Did the following

❯ mkdir accent_test
❯ cd accent_test
❯ git init
Initialized empty Git repository in /Users/onigoetz/Sites/Libs/accent_test/.git/
❯ echo "My GitHub Page" > accentué.txt
❯ git add *
❯ git commit -m "first commit"
[master (root-commit) 458db71] first commit
 1 file changed, 1 insertion(+)
 create mode 100644 accentué.txt

And was able to run absorption on it as expected.

Can you please try with version 0.6.0 if you still have the same issue ?