./scripts/env unable to create new environment

I am using multiple environments on my local master clone. When I try to add a new one, I'm seeing this weird message:

~/code/lede/master$ ./scripts/env new er4
Do you want to clone the current environment? (y/N): n
fatal: 'master' is not a commit and a branch 'er4' cannot be created from it
~/code/lede/master$ git branch
* master

A sanity check shows already plenty of environments:

~/code/lede/master$ ./scripts/env list
  amd64-unoptimised
  apu2
  ath79_generic
  ath79_tiny
  default
  fritz7362sl
  ipq40xx
* mt7621

Does anybody have an idea what's going on here? I tried an environment name without a digit, but no difference (besides, there's plenty including digits already there).

As a follow-up, I am able to create a new environment on a git clone without any pre-existing environments. I'm really interested in debugging this.

1 Like

use set -x in env ... your output shows default... mine shows master...

how did default get there? rename?

1 Like

These aren't branches, but environments. The branches are master, openwrt-19.07, and a local master-prep branch.

I found this meanwhile and I'l be trying a git fetch:

that could likely be the issue...

The possible fixes the internet offered did not help. However, it turns out simply allowing ./scripts/env to copy the existing environment works fine. It's not a clean slate of course, but that's easily remedied by wiping ./env/{.config,files}.


~/code/lede/master$ ./scripts/env new gs1900-10hp
Do you want to clone the current environment? (y/N): y
Switched to a new branch 'gs1900-10hp'
~/code/lede/master$ ./scripts/env list
  amd64-unoptimised
  apu2
  ath79_generic
  ath79_tiny
  default
  er4
  fritz7362sl
* gs1900-10hp
  ipq40xx
  mt7621

Et voilà! :smiley: I'm a happy camper again! :sunglasses:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.