lindell / multi-gitter

Update multiple repositories in with one command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"unknown escape sequence" when running with --git-type=go

aseppala opened this issue · comments

Describe the bug

I'm trying to use multi-gitter with Bitbucket Server. However, when I'm executing any script with run command, I'm getting following error:

8:22: unknown escape sequence (and 4 more errors)

I've not been able to get the tool working at all due to this. I wonder if this is a bug or some problem with my setup.

To Reproduce

Steps to reproduce the behavior:

  1. Create any script that modifies a file, e.g.
#!/bin/bash
echo "hello" >> hello
  1. Run multi-gitter run ./hello.sh -O SOMEPROJECT -m"hello" -B multi-gitter
  2. See error
INFO[0026] Running on 171 repositories
INFO[0026] Cloning and running script                    repo=SOMEPROJECT/repo1
INFO[0065] 8:22: unknown escape sequence (and 4 more errors)  repo=SOMEPROJECT/repo1
INFO[0065] Cloning and running script                    repo=SOMEPROJECT/repo2
INFO[0066] 8:22: unknown escape sequence (and 4 more errors)  repo=SOMEPROJECT/repo2
INFO[0066] Cloning and running script                    repo=SOMEPROJECT/repo3
INFO[0087] 8:22: unknown escape sequence (and 4 more errors)  repo=SOMEPROJECT/repo3
...

Expected behavior

Expectation is to get PRs created with the scripted change.

Additional context

I'm on MacOS and version:

multi-gitter version: 0.43.3
Release-Date: 2022-12-30
Go version: go1.19.4
Commit: 4925583322976f7f399b6276881bab50e2f5d544

No extra details in trace logs.

What do you get if you run the script directly in a cloned-down repo?

/absolute/path/you-script.sh in the context of the repo.

And to answer your original question

I wonder if this is a bug or some problem with my setup.

It seems to be your setup in some way. But please let me know if it does seem to be.


Example run:

cat > hello.sh <<- EOM
#!/bin/bash
echo "hello" >> hello
EOM
chmod +x hello.sh
multi-gitter run ./hello.sh -m "test" -O multi-gitter-test

image

I have a quick update on this. My problem is related to the built-in git library. With --git-type=cmd the tool works.

$ multi-gitter run $(pwd)/hello.sh -O SOMEPROJECT -m"test multi-gitter" -B multi-gitter --log-level=trace --dry-run --git-type=cmd
...
INFO[0001] Running on 5 repositories
INFO[0001] Cloning and running script                    repo=SOMEPROJECT/repo1
DEBU[0004] diff --git a/hello b/hello
new file mode 100644
index 0000000..ce01362
--- /dev/null
+++ b/hello
@@ -0,0 +1 @@
+hello

Running the script directly:

multi-gitter-test-repo on  main
➜ ~/multi-gitter/hello.sh

multi-gitter-test-repo on  main [?]
➜ ls
hello

multi-gitter-test-repo on  main [?]
➜ cat hello
hello

Hey, again @aseppala. Could you test if this problem still occurs on the latest release?

Also, are you running on Intel or Apple Silicon?

I will close this issue for now. But please reopen it if the issue still persists.