Giter VIP home page Giter VIP logo

Comments (1)

jfultz avatar jfultz commented on June 13, 2024

First, nothing will work if GitFetch doesn't work. I.e., the transport protocol needs to be functioning. So, before you read anything else, ensure that the fully documented and supported GitFetch works. Unfortunately, GitLink doesn't support the full range of transport protocols, and doing so is a lot of detailed fiddly work that's not likely to be done by me anytime soon. I've implemented the protocols I need (in true, open source fashion 😄 ).

The reason GitPush isn't documented is because right now the only acceptable form is a modestly user-hostile form used internally by git, and I wasn't eager to document that. But it works, and we've used it plenty internally at Wolfram. The syntax is GitPush[repo_GitRepo, remote_String, refspec_String]. Which seems simple enough. Except that most of the things you think might work for refspec don't.

See the documentation for refspec here (second item under the Options heading). There are limitations on what can be used...some I remember for sure and some may or may not be limitations...I can't recall for certain what's supported by the current libgit2 git_remote_upload function:

  • Inferencing of the refs/heads/ namespace is not supported; you absolutely must include that explicitly for source and destination
  • I don't recall, but I think that it doesn't auto-detect the upstream branch, and so you must use the source:dest form of the refspec to explicitly specify source branch (in your local repo) and the destination branch (in the remote repo)
  • There's no force option, so you must use + if you want to force push
  • I honestly don't think I've ever tried pushing tags; it's unclear to me whether just using a refspec in the refs/tags/ namespace would work or not.

Since I originally wrote this, libgit2 added a git_remote_push() function (yes, this was originally written so long ago that libgit2 didn't even have a properly codified push). It's unclear to me whether reimplementing this with git_remote_push() would do all of the expected refspec inferencing/upstream detection/etc., or whether I'll have to replicate that logic in GitLink.

If you want to see examples that work, check out the GitPush tests in Push.wl. These tests do work, except that they refer to a remote that you won't have access to.

In summary, it does work...with limitations and user hostility that I'll acknowledge. None of these is a bug. But there are certainly features that could be improved here.

from gitlink.

Related Issues (13)

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.