I'll look around a bit more to consider this. It's just one of the things. Still looking around isomorphic-git to decide if I could use it ;)
By the way, are all indexes version 2 in practice?
After going deeper: the answer is NO, because GitIndex
doesn't store them.
Proposed to fix in #1727.
In case of a conflict, the "original" git stores multiple versions of a path in the index, under different "stage" numbers.
Here's an example of ls-files
in a repo with a conflict on index.html
:
➜ tmpgit git:(master) ✗ git ls-files --stage
100644 e8e448b33545a4ff26011d77ccc46c0b879f50be 1 index.html
100644 da9736cb76038951b7931f826336a23d21ffb03a 2 index.html
100644 f4952f928d1644e8bfcccc5c96cee07712d7dbaa 3 index.html
100644 ec0966979aa7da1907f1c205b87c173050d7a223 0 script.js
GitIndex
uses _entries
as Map(path => data)
, so it's incapable to represent this structure.
The suggestion is to change it. Make it an array instead OR store different stages in data
.
I have a code to read a real folder from File Access API into lightningFS.
The repo is about 800kb, has 300 files.
The code works very slowly, because of writeFile.
I've read that indexedDB throttles it, is that so? How to speedup?
Here's the code, it recursively reads all dirs/files and uses fs.promises.writeFile
to write them to lightningFS.
This writeFile
call is the main reason for the delay, even though the data is very small.
let fs = new LightningFS('fs', {wipe: true});
let relPath = [''];
async function handle(dirHandle) {
console.time(dirHandle.name);
for await (const entry of dirHandle.values()) {
if (entry.kind === "file") {
const file = await entry.getFile();
let data = new Uint8Array(await file.arrayBuffer());
let filePath = [...relPath, file.name].join('/');
await fs.promises.writeFile(filePath, data);
}
if (entry.kind === "directory") {
const newHandle = await dirHandle.getDirectoryHandle( entry.name, { create: false } );
relPath.push(entry.name);
let dirPath = relPath.join('/');
await fs.promises.mkdir(dirPath);
await handle(newHandle);
relPath.pop();
}
}
}
I tried to walk, like this, but I only see index.html
once here, not 3 times:
await git.walk({
fs,
dir: '/',
trees: [git.STAGE()],
map: async function(filePath, [A]) {
...
}
});
In other words, the walker doesn't show all 3 entries of index.html
in the index.
In case of conflict, git stores multiple versions of file in index.
Here's an example:
➜ tmpgit git:(master) ✗ git ls-files --stage
100644 e8e448b33545a4ff26011d77ccc46c0b879f50be 1 index.html
100644 da9736cb76038951b7931f826336a23d21ffb03a 2 index.html
100644 f4952f928d1644e8bfcccc5c96cee07712d7dbaa 3 index.html
100644 ec0966979aa7da1907f1c205b87c173050d7a223 0 script.js
How can I get similar information from isomorphic-git?
Have you made any PRs already?
On 30 Jan 2023, at 17:49, Leopoldo V Fonseca @.***> wrote:
Actually, i dont know others mainteners, to get aprovall
Em seg, 30 de jan de 2023 04:55, Ilya Kantor @.***> escreveu:
Hi,
Yes, great. Other maintainers are ok with that?
— Reply to this email directly, view it on GitHub https://github.com/javascript-tutorial/en.javascript.info/issues/3344#issuecomment-1408138616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6EQZHSIV6RCFYG7XS3VYTWU5XV7ANCNFSM6AAAAAAUKS4LEU . You are receiving this because you authored the thread.Message ID: @.***>
— Reply to this email directly, view it on GitHub https://github.com/javascript-tutorial/en.javascript.info/issues/3344#issuecomment-1408970796, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACVJGC74JJZBLQE5DGFV2DWU7WLBANCNFSM6AAAAAAUKS4LEU. You are receiving this because you commented.
Leopoldo https://github.com/leopoldovcfonseca wants to join, looks good?
Hi,
Yes, sure. Other maintainers are ok with that?
Please keep in mind: not only maintainers need to carefully review all your changes, but translators to other languages will see them as well.
Don't rephrase just because you can. There must be a reason.
Many modifications seem to be excessive.
Maybe I'm just not getting something, @p2635 why did you replace "a lot of" with "many"?
grammar & legility (to check)
Merge pull request #3302 from joaquinelio/patch-19
grammar & legibility (to check)
non-native warning The problem: I fixed it the spanish way, maybe wrong.
The situation when the browser sent a request and has a pending connection with the server, is standard for this method.
I think the comma before "is" should be removed. Workaround: 2 commas.
Some programming languages allow to use negative indexes for the same purpose, like fruits[-1].
should be:
Some programming languages allow "us" to use negative indexes for the same purpose, like fruits[-1].
Fix a typo
Update 1-js/05-data-types/04-array/article.md
Co-authored-by: Bogdan Bacoșcă bogdanbacosca@protonmail.com
Merge pull request #3332 from MAHIN0093/change
Fix the article.md Resolves #3307
Fix "JavaScript specials" links
Merge pull request #3330 from odsantos/fix-javascript-specials-links
Fix "JavaScript specials" links
Update button to fix horizontal scroll on mobile
Since the button is causing mobile screen users to have a horizontal scroll, I've fixed it giving it a max-height.
This removes the horizontal scroll that the button was causing on the entire page for mobile readers.
Merge pull request #3334 from marcusicaro/patch-1
Update button to fix horizontal scroll on mobile
Since the button is causing mobile screen users to have a horizontal scroll, I've fixed it giving it a max-height.
This removes the horizontal scroll that the button was causing on the entire page for mobile readers.
fix: add missing word 'to'
correct statement grammar by adding missing word 'to'
Merge pull request #3336 from JeraldVin/patch-1
fix: add missing word 'to' - Pointer events
correct statement grammar by adding missing word 'to'
One PR per article. May be many commits.
Well, I come and cover all PRs from time to time, just not daily ;)
It's actually high time to do that ;)