Git Product home page Git Product logo

upgrade-scripts-for-0.7's People

Contributors

gaoyifan avatar hexchain avatar hoop33 avatar huiyiqun avatar muesli avatar neilberget avatar xiaq avatar zguangyu avatar zhsj avatar zirak avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

seanpm2001

upgrade-scripts-for-0.7's Issues

Possible overlooked syntax changes for 0.7 changes

The syntax changes made in the 0.7 release broke a function in one of my scripts that this tool possibly overlooked (not sure if it would fall under the scope of this tool or my script just has a weird edgecase).

The code snippet in question is

fn commit-count {
  splits &sep="\t" (git rev-list --count --left-right "@{upstream}...HEAD" 2>/dev/null)
}

fn ahead {
  if (is-detached) {
    put detached; return
  }

  try {
    {commits-behind,commits-ahead} = (commit-count)
  } except {
    put none; return
  }

  if (== $commits-behind 0) {
    if (== $commits-ahead 0) {
      put none
    } else {
      put ahead
    }
  } else {
    if (== $commits-ahead 0) {
      put behind
    } else {
      put diverged
    }
  }
}

The line in the try block {commits-behind,commits-ahead} = (commit-count) given the following error when launching elvish:

Exception: Compilation error: must be an lvalue 
  /home/vendion/.elvish/lib/git.elv, line 100:
        {commits-behind,commits-ahead} = (commit-count)
Traceback:
  /home/vendion/.elvish/rc.elv, line 8:
    use git

In case you need them here are the full scripts that are affected git.elv and git-prompt.elv

I'm not sure what the new syntax is for doing a multiple assignment from a function call is now, or if that is still even possible. Other than this issue the tool to update the scripts seemed to work nicely.

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.