wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.4k stars 137 forks source link

ga preview not working with fish #170

Closed flanaras closed 2 years ago

flanaras commented 2 years ago

Check list

Environment info

Problem / Steps to reproduce

When using the latest version with fish, installed either with fisher install wfxr/forgit or source (curl -sSL git.io/forgit-fish | psub), ga shows the following error.

fish: $\ is not a valid variable in fish.
        sed -e 's/^\\\"//' -e 's/\\\"\$//'  # removes surrounding quotes
                                      ^

This is on a folder that contains a git repository.

similar to #168

cjappl commented 2 years ago

Yeah, agreed something changed recently. Let me see if I can look into it

cjappl commented 2 years ago

@flanaras will you download the local file and try this as a fix? Just to test it before I commit it:

Replace the part in function forgit::add -d "git add selector" with this:

        set extract_file "
        sed 's/^[[:space:]]*//' |           # remove leading whitespace
        cut -d ' ' -f 2- |                       # cut the line after the M or ??, this leaves just the filename
        sed 's/.* -> //' 
    "
flanaras commented 2 years ago

@flanaras will you download the local file and try this as a fix? Just to test it before I commit it:

Replace the part in function forgit::add -d "git add selector" with this:

        set extract_file "
        sed 's/^[[:space:]]*//' |           # remove leading whitespace
        cut -d ' ' -f 2- |                       # cut the line after the M or ??, this leaves just the filename
        sed 's/.* -> //' 
    "

Hi @cjappl, this makes the ga preview to work again.

Thanks for the timely response.

cjappl commented 2 years ago

awesome :) Same to you!!

I'll get this submitted in just a sec