Comments (13)
Would it be possible for you to create an example repository on github such that:
- one can just clone it, and fix two lines in the settings (API key + repository name)
- have a very basic website running on github pages (for example some buttons that run example queries)
And as a bonus, people get to experiment via the console automatically.
This would provide a sort of skeleton upon which I could build further.
For example, as a first project, to test whether I get how this works, I would then try to evolve my clone into an online github editor, provide a basic file browser + codemirror frame for editing & writing commit messages.
from isomorphic-git.
Aw wow! Thanks and congrats on being (to my knowledge) the first person to try using this library! You are certainly the first issue.
Hmm. Your example seems to illustrate some serious oversights in my documentation. I will try to improve that. I think what it needs is more interactive examples. Meanwhile, I'll try to build a jsfiddle for you.
from isomorphic-git.
OK, so there's a bug where the code crashes if you try to push to a completely empty (new) repository on Github, which I'll try to address this week. But here's how your code would look, more or less:
BrowserFS.configure({ fs: "InMemory", options: {} }, function (err) {
if (err) return console.log(err);
window.fs = BrowserFS.BFSRequire("fs");
main();
});
async function main () {
await git('.').init();
await git('.').config('remote.origin.url', 'https://cors-buster-jfpactjnem.now.sh/github.com/wmhilton/congenial-waffle');
fs.writeFile('README.md', 'Test', 'utf8', async (err) => {
if (err) throw err;
console.log('The file has been saved!');
await git('.').add('README.md');
await git('.').commit('Test commit');
await git('.').auth('mysecret').remote('origin').push('master'); // Here's where it crashes trying to push to an empty repo
});
}
from isomorphic-git.
Thanks for your reply.
I've used github to create an initial commit with a README.md
.
After using your suggested code to create a second commit, I get the following error in the browser console:
Failed to read git object with oid c932a85ce627b448152792a40b755f8c8e224fed
Is there anything I can do to help debugging this issue?
from isomorphic-git.
I did have a very basic website & demo on CodeSandbox and wanted to give you a link after your first post, but when I went to get the link for you I discovered that my demo was broke: https://codesandbox.io/s/mj77r46xkp
I think it would be fair to say it's not really ready for people to use. :( My own fault. It's close. It's getting closer! I'll say January will be my 1.0 release that Just Works (TM).
However, it sounds like you are interested in building a file browser / code editor / IDE of the future, in which case if you're bold enough I'd love for you to alpha test https://github.com/wmhilton/nde It only works in very recent versions of Chrome and Firefox though.
Edit: right now nde is at https://nde.now.sh and has a painfully long installation process with cat gifs, but I'm eventually going to have a "works right away without a long installer experience" at https://wmhilton.github.io/nde
from isomorphic-git.
One of the things I'm going to do, after talking with you and @CMCDragonkai, is to ditch the "fluent" API
git("dir").option("value").option("value").command("value")
that was supposed to be convenient, but in practice has been
a) difficult to debug and
b) confusing because options and commands look similar
for something more like this:
var repo = new Git(config);
await repo.command({
option1: "value",
option2: "value",
option3: "value"
})
from isomorphic-git.
Hmmm, so I have left nde.now.sh running in Firefox 57 for over an hour, and it is still playing cat gifs...
Concerning my own plans: what I want to build is a combination of personal-wiki and graph-editor. So you have a graph (rendered by d3js or something) and all the nodes contain a bunch of text (markdown or something) a hyperlink from one piece of text to another would create a directed edge between the corresponding nodes in the graph. All of this should be backed by a git repo.
from isomorphic-git.
Hmmm, so I have left nde.now.sh running in Firefox 57 for over an hour, and it is still playing cat gifs...
Oh no it shouldn't take that long. A minute tops. Sounds like you didn't get a progress bar. I mean, if you really want to try it out ASAP you can try closing the cache, unregistering the SW and refreshing... or just give me a few more weeks until I get all the kinks ironed out. :)
The wiki graph "mind map" editor sounds really cool, and is exactly the kind of creative project that I was hoping this library would enable! I'll help you get there. I'm limited by my day job to working on the project in the evenings and weekends, but I'm pretty confident that I'll have the new simpler API out by this weekend.
from isomorphic-git.
@wDhTIG I moved the API documentation to https://wmhilton.github.io/isomorphic-git I still need to add examples. But meanwhile you can look at the test cases to get an idea.
from isomorphic-git.
Thanks! This looks great. I will see what I can do with it. I'll keep you updated.
from isomorphic-git.
Just wanted to announce the new Gitter chat room: https://gitter.im/isomorphic-git/Lobby
And I am actively working on making an interactive tutorial on Github pages where you'll be able to run isomorphic-git
in the console and play with a sample Github repo!
from isomorphic-git.
Status Update
Pretty sure I still need to fix this bug
from isomorphic-git.
I just confirmed I am able to push to an empty repository on Github:
$ isogit push --username=wmhilton --password=$GITHUB_TOKEN --url=https://github.com/wmhilton/empty
>> git.push({fs, dir: '.', "username":"wmhilton","password":"XXXXXXXXXXXXX","url":"https://github.com/wmhilton/empty"})
{
"ok": [
"unpack",
"refs/heads/master"
]
}
Also, after adding a remote and creating a new branch, I was able to push that new branch:
$ isogit push --username=wmhilton --password=$GITHUB_TOKEN
>> git.push({fs, dir: '.', "username":"wmhilton","password":"XXXXXXXXXXX"})
{
"ok": [
"unpack",
"refs/heads/newbranch"
]
}
Since I'd renamed this issue to "Unable to push to empty repository on GitHub" and that appears to not be a problem anymore, I shall close this issue. But continue to create new issues and to chat in Gitter as you encounter new obstacles!
from isomorphic-git.
Related Issues (20)
- Improve `normalizePath` performance HOT 6
- pushing a tag to a target branch fail HOT 1
- Empty response from git server when using code bundler HOT 33
- Pushing returning 401 Error: No Anonymous Write Access HOT 6
- Tests are failing on Android HOT 15
- Cloning empty repository fails if git server uses git >= 2.41.0 HOT 5
- Getting a 404 with azure devops HOT 1
- not respecting server capabilities ( report-status ) HOT 1
- How can I abort a push operation on Node? AbortController seems to be not supported. HOT 2
- Codespell workflow needs approval
- Disable failing test that require credentials on Azure DevOps HOT 14
- Race condition makes it possible for a ref to be resolved to an empty string while it's in the middle of being updated HOT 16
- Invalid refs should throw HOT 11
- Isomorphic git functionality is broken on any browser
- Error Running Linter on main locally HOT 4
- Github Clone Broken on Latest Version HOT 6
- Pushing an annotated tag has slightly different behavior between isomorphic-git and Git HOT 1
- StatusMatrix results are different on Windows and Linux HOT 2
- Unchanged image/audio files being queued for commit with `git.add()` HOT 3
- BrowserFS deprecated HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isomorphic-git.