Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support shells other than bash #3

Closed
sethfowler opened this issue Sep 5, 2016 · 6 comments
Closed

Support shells other than bash #3

sethfowler opened this issue Sep 5, 2016 · 6 comments

Comments

@sethfowler
Copy link

The git rebase exec command runs with the user's default shell. git-fiddle uses bash syntax, so it'd probably be wise to explicitly invoke bash. Otherwise, git-fiddle won't work for people who use, for example, the fish shell.

@felixSchl
Copy link
Owner

Yeah sure, but the actual code run with exec is a one liner to git commit --amend. I haven't used fish much, but it works fine with zsh which I use. I wonder if we can get travis to run it through a couple of shells to test this out. Also all shell code should be bash 3 compatible since that's what ships with OSX. I also have to use a version of awk from 2007 (not that I use it much in this project).

@sethfowler
Copy link
Author

It doesn't work with fish because you set an environment variable temporarily using the syntax "VAR=foo command". zsh is largely compatible with bash, but fish isn't, and that syntax doesn't work.

I think it's simpler to invoke "bash -c" than to worry about configuring travis to run your code through multiple shells, but you're the boss. =)

@sethfowler
Copy link
Author

FWIW, here's the error from fish, scrubbed of the info about the particular commit:

Executing: GIT_AUTHOR_DATE='???' git commit --amend --no-edit --date='???'
--author='???' --message=$'???'
Unknown command 'GIT_AUTHOR_DATE=???'. Did you mean to run git with a modified
environment? Try 'env GIT_AUTHOR_DATE=??? git…'. See the help section on the set command by typing 'help set'.
fish: GIT_AUTHOR_DATE='???' git commit --amend --no-edit --date='???'
--author='???' --message=$'???'

felixSchl added a commit that referenced this issue Sep 5, 2016
@felixSchl
Copy link
Owner

felixSchl commented Sep 5, 2016

I took an initial stab at this (60aa142). The problem is that the input to -c needs to be quoted, which in turns means I have to ensure that the string I am passing is escaped properly, so not to accidentally unquote. I wonder if there's a easy solution to this. For now I just did sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' to escape backslashes and double quotes.

felixSchl added a commit that referenced this issue Sep 5, 2016
@felixSchl
Copy link
Owner

@sethfowler I installed fish and with the last two commits it appears to be working. Can you confirm?

@felixSchl
Copy link
Owner

I'm gonna close this. You can re-open if it still breaks for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants