gh-poi: Failed to run external command: git, args: [branch --merged origin/]

Describe the bug When I install this extension and try to run it with gh poi --dry-run, I receive the following output:

» gh poi --dry-run
== DRY RUN ==
✕ Fetching pull requests...
failed to run external command: git, args: [branch --merged origin/]
exit status 128

Your Environment

  • OS: macOS 12.6
  • gh (Check with gh --version): 2.18.0
  • gh-poi (Check with gh ext ls): v0.6.3
  • git: 2.37.0 (Apple Git-136)

This seems to be the case regardless of which repo I run it in.

If I run git branch --merged origin or git branch --merged origin/, I get this output:

fatal: malformed object name origin

I’m not sure how to further debug this, but I’m happy to help however I can!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

@seachicken thank you!

Just FYI gh doesn’t allow upgrading pinned extensions:

» gh ext upgrade poi --force                        
X Failed upgrading extension poi: pinned extensions can not be upgraded

So I just did gh ext remove poi and then gh ext install seachicken/gh-poi and that worked great!

Thank you! Here’s what I get after upgrading:

» gh poi --debug | grep "repo view"
error unmarshaling response: invalid character '\x1b' looking for beginning of value
run gh [repo view github.com/apiabroad/portal-student --json owner --json name --json parent --json defaultBranchRef] -> {

And here’s the full output, in case it’s helpful:

» gh poi --debug                   
run git [remote -v] -> origin	git@github.com:apiabroad/portal-student.git (fetch)
origin	git@github.com:apiabroad/portal-student.git (push)

run ssh [-T -G github.com] -> *****
run gh [repo view github.com/apiabroad/portal-student --json owner --json name --json parent --json defaultBranchRef] -> {
  "defaultBranchRef": {
    "name": "staging"
  },
  "name": "portal-student",
  "owner": {
    "id": "MDEyOk9yZ2FuaXphdGlvbjE0ODgwNDYy",
    "login": "apiabroad"
  },
  "parent": null
}

✕ Fetching pull requests...
error unmarshaling response: invalid character '\x1b' looking for beginning of value

Interesting, a new error!

Does this provide more/better information?

» gh ext upgrade poi
✓ Successfully upgraded extension poi

» gh poi --dry-run
== DRY RUN ==
✕ Fetching pull requests...
error unmarshaling response: invalid character '\x1b' looking for beginning of value

» gh repo view github.com/apiabroad/portal-student --json owner --json name --json parent --json defaultBranchRef
{
  "defaultBranchRef": {
    "name": "staging"
  },
  "name": "portal-student",
  "owner": {
    "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "login": "apiabroad"
  },
  "parent": null
}

Hmm, that does result in an error:

» gh api --hostname ssh.github.com repos/apiabroad/portal-student --silent
Get "https://api.ssh.github.com/repos/apiabroad/portal-student": x509: “*.github.com” certificate name does not match input

I do have this in my ~/.ssh/config:

Host github.com
	Hostname ssh.github.com
	Port 443
	ForwardAgent yes

Thank you! Here’s what I get – I’m not sure I did exactly what you were asking; please let me know if I’ve messed up anywhere 😊

» git remote -v                       
origin	git@github.com:apiabroad/portal-student.git (fetch)
origin	git@github.com:apiabroad/portal-student.git (push)

» ssh -T -G github.com | grep hostname
hostname ssh.github.com
canonicalizehostname false

» gh repo view ssh.github.com/apiabroad/portal-student --json defaultBranchRef
{
  "defaultBranchRef": {
    "name": "staging"
  }
}

@seachicken thanks for the reply! Here’s what I get:

» gh repo view --json defaultBranchRef
{
  "defaultBranchRef": {
    "name": "staging"
  }
}