Closed cjappl closed 1 year ago
I can confirm that it should be git revert
. I accidentally introduced this bug in #296, sorry for that.
Concerning the evaluation: does gcb
work correctly for you? We're using the same mechanism via the git command in a variable there, without eval
.
Confusingly enough, (after I change it to git revert
)
gcb
does workgrc
does not work....
Any ideas what I could do to troubleshoot? Even completely simplifying like so has the same result:
@@ -534,7 +534,7 @@ _forgit_branch_delete() {
_forgit_revert_commit() {
_forgit_inside_work_tree || return 1
local git_revert cmd opts files preview commits IFS
- git_revert="git branch $FORGIT_REVERT_COMMIT_GIT_OPTS"
+ git_revert="git revert"
[[ $# -ne 0 ]] && { $git_revert "$@"; return $?; }
cmd="git log --graph --color=always --format='$_forgit_log_format' $* $_forgit_emojify"
@@ -565,7 +565,7 @@ _forgit_revert_commit() {
[ ${#commits[@]} -eq 0 ] && return 1
- $git_revert "${commits[@]}"
+ $git_revert
}
# git blame viewer
/Users/chrisapple/code/personal//forgit/conf.d/bin/git-forgit: line 568: git revert: command not found
Hmm, that's strange. What about ga
, grh
, gss
, gsp
, gclean
, gcp
, grb
, gcf
and gct
? Those commands all don't use eval
. Can you verify which of them work for you?
Maybe it has to do with the temporary changing of IFS
within grc
. We're doing this in gcp
as well, though, so it would be interesting if that works.
FYI: I already fixed the wrong git call in #305.
✅ gcp
works as intended
✅ ga
✅ gcf
✅ grh
✅ gss
✅ gsp
✅ gclean
✅ grb
✅ gcf
✅ gct
❌ grc
/Users/chrisapple/code/personal//forgit/conf.d/bin/git-forgit: line 568: git revert: command not found
hmm.... the plot thickens. Everything is perfectly good except for this one.
Crazy. 😳 Just to be sure: for testing you called all the commands without any arguments, using the interactive fzf selector to choose the objects, right?
Yep that is correct, so
‘grc’
No, I meant exactly the opposite 😋:
‘grc’
\
If you're using \
Both versions result in the same thing, using either
grc
Funny thing: I can actually reproduce the error. Hadn't checked this, yet, haha. 🙈 I already found the issue, it really had to do with the setting of IFS, like I suspected. I am preparing a PR.
When trying to run grc this morning, I got the error:
/Users/chrisapple/code/personal//forgit/conf.d/bin/git-forgit: line 568: git branch : command not found
I think there are two things going wrong here:
git revert
notgit branch
Repro'd on OSX