Hmmm, that's a tough one. Would it be possible that one of you git config file (either repo local, or global) has some formatting or weird character in it?
It's hard to know without a debugger, but my guess would be that go-git fail to read one of your config file.
Matěj Cepl (mcepl) commented
Hmmm, that's a tough one. Would it be possible that one of you git config file (either repo local, or global) has some formatting or weird character in it?
As far as I know, the default encoding is UTF-8, so my name shouldn’t be a problem, should it?
So, I followed the trail, it seems that this error is triggered in https://github.com/go-git/gcfg. This is the package that go-git use to read the git configuration. It's so ancient and unmaintained that there is 1) no go.mod and 2) it has copies of golang's scanner.Scanner, where that error comes from: https://github.com/go-git/gcfg/blob/v1/scanner/errors.go#L97
Now, to fix that, it would really help if you could come up with a small example that makes the parser fault.
Matt Broadway (mbway) commented (edited)
I am getting this error too and for me the problem is having an alias spanning multiple lines by escaping a newline. For example having this in my ~/.gitconfig:
[alias]
myalias = "!f(){ \
echo hello; \
};f"
results in:
$ git bug user create
Error: 2:23: unknown escape sequence (and 1 more errors)
as a workaround I'm going to replace these aliases with scripts named git-aliasname in my $PATH instead (which is probably nicer anyway)
I am getting this error too and for me the problem is having an alias spanning multiple lines by escaping a newline. For example having this in my ~/.gitconfig:
[alias]
myalias = "!f(){ \
echo hello; \
};f"
results in:
$ git bug user create
Error: 2:23: unknown escape sequence (and 1 more errors)
as a workaround I'm going to replace these aliases with scripts named git-aliasname in my $PATH instead (which is probably nicer anyway)
Actually, it seems that's it. I had this alias in my ~/.config/git/config, and when I comment it out git-bug starts to work: