Git Product home page Git Product logo

Comments (13)

wDhTIG avatar wDhTIG commented on May 14, 2024 2

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.

billiegoose avatar billiegoose commented on May 14, 2024

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.

billiegoose avatar billiegoose commented on May 14, 2024

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.

wDhTIG avatar wDhTIG commented on May 14, 2024

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.

billiegoose avatar billiegoose commented on May 14, 2024

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.

billiegoose avatar billiegoose commented on May 14, 2024

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.

wDhTIG avatar wDhTIG commented on May 14, 2024

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.

billiegoose avatar billiegoose commented on May 14, 2024

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.

billiegoose avatar billiegoose commented on May 14, 2024

@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.

wDhTIG avatar wDhTIG commented on May 14, 2024

Thanks! This looks great. I will see what I can do with it. I'll keep you updated.

from isomorphic-git.

billiegoose avatar billiegoose commented on May 14, 2024

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.

billiegoose avatar billiegoose commented on May 14, 2024

Status Update

Pretty sure I still need to fix this bug

from isomorphic-git.

billiegoose avatar billiegoose commented on May 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.