question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

statusMatrix() did not find modified files when working with package capacitor-fs

See original GitHub issue

I am using Browser and Webpack 5, capacitor-fs

I cloned a repo and found the files that were changed but nothing came back

My code;

import FS from "capacitor-fs"
import git from "isomorphic-git"
import http from "isomorphic-git/http/web/index.js"

const fs = new FS({
  rootDir: "/",
  base64Alway: false
})

await git.clone({
  fs,
  http,
  dir: "/fcanvas",
  url: "https://github.com/shin-tachibana/fcanvas"
})

await fs.writeFile("/fcanvas/new file.txt", "hello new file.txt", "utf8")
await fs.writeFile("/fcanvas/README.md", "change content readme " + Math.random(), "utf8")

const matrix = await git.statusMatrix({
  fs,
  dir: "/fcanvas"
})

console.log(matrix) 
/*
  [
    ["new file.txt", 0, 2, 0]
  ]

  expectations:
  [
    ["new file.txt", 0, 2, 0],
    ["README.md", 2, 1, 2]
  ]
*/

My packages:

{
  "dependencies": {
    "@capacitor/core": "^3.1.2",
    "@capacitor/filesystem": "^1.0.2",
    "isomorphic-git": "^1.9.2",
    "buffer": "^6.0.3",
    "capacitor-fs": "^0.0.25",
    "core-js": "^3.6.5",
    "path-cross": "^0.0.3",
    "quasar": "^2.0.0",
    "vue-i18n": "^9.0.0-beta.0",
    "vue-timeago.js": "0.0.2",
    "vuex": "^4.0.1",
    "vuex-persistedstate": "^4.0.0"
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
wmhiltoncommented, Aug 21, 2021

OK! Here, try copying https://github.com/isomorphic-git/statusMatrix/blob/main/statusMatrix.mjs into your project (upgrade to isomorphic-git version 1.10.0 for the isIgnored command) and then you can make whatever adjustments you need!

Honestly, statusMatrix has rather confusing output, so it wouldn’t surprise me if most people prefer to start with that as a base and then modify it rather than use the version I wrote 🤷🏻.

0reactions
tachibana-shincommented, Aug 22, 2021

This is the perfect solution to my problem, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'git status' shows changed files, but 'git diff' doesn't
This is why I encounter the issue. Git keeps telling me my modification of line-ending has been changed and asks whether to commit...
Read more >
statusMatrix - isomorphic-git
Efficiently get the status of multiple files at once. ... type StatusRow = Array<(string|number)>;. The returned StatusMatrix is admittedly not the easiest format ......
Read more >
Get list of modified files between two commits #732 - GitHub
Given two commits x and y (identified by their hash), it is possible to list all files which have been modified in y...
Read more >
Git commit modified file list display error
When git commit, in the list of modified files displayed, compare some files and find that there is no change to one line...
Read more >
reliable way to find added/modified files by make install
One sample way to get the list of file operations done by make install is to execute: make -n install. This command will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found