PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: nats-io/nsc (go)

Issue:
Wrong output in `nsc reissue operator`
### What version were you using?

nsc version 2.8.0
nats-server version 2.9.22


### What environment was the server running in?

Linux VM, arm64, docker images:

- nats:2.9.22-scratch
- natsio/nats-box:0.13.9

### Is this defect reproducible?

1. Run `nsc reissue operator --convert-to-signing-key`

### Given the capability you are leveraging, describe your expectation?

The output should show the old key being turned into a signing key
```
[ OK ] operator "O" successfully changed identity to: {new_key}
[ OK ] old operator key "{old_key}" turned into signing key
```

### Given the expectation, what is the defect you are observing?

The output shows the new key as the old operator key:
```
$ nsc reissue operator --convert-to-signing-key
[ OK ] operator "O" successfully changed identity to: OBUGUUS5PYPNSNXCZ6TYAHYYKW5L2CH3XXTZW5IJPVCCR4CORRONC7JH
[ OK ] old operator key "OBUGUUS5PYPNSNXCZ6TYAHYYKW5L2CH3XXTZW5IJPVCCR4CORRONC7JH" turned into signing key
all jobs succeeded
```

Pull request:
Fixed output of nsc reissue operator --convert-to-signing-key
Fixes #609 

Patch:
diff --git a/cmd/reissueoperator.go b/cmd/reissueoperator.go
index eb65f2e..1a6722b 100644
--- a/cmd/reissueoperator.go
+++ b/cmd/reissueoperator.go
@@ -149,7 +149,7 @@ func (p *reIssueOperator) Run(ctx ActionCtx) (store.Status, error) {
 	}
 	r.AddOK("operator %q successfully changed identity to: %s", op.Name, opPub)
 	if p.turnIntoSigningKey {
-		r.AddOK("old operator key %q turned into signing key", opPub)
+		r.AddOK("old operator key %q turned into signing key", oldPubKey)
 		return r, nil
 	}
 	accounts, err := s.ListSubContainers(store.Accounts)


Test patch:
diff --git a/cmd/reissueoperator_test.go b/cmd/reissueoperator_test.go
index e495736..c3d9efb 100644
--- a/cmd/reissueoperator_test.go
+++ b/cmd/reissueoperator_test.go
@@ -35,11 +35,18 @@ func Test_ReIssue(t *testing.T) {
 	// add testing account
 	ts.AddAccount(t, "A")
 
-	_, _, err = ExecuteCmd(createReIssueOperatorCmd(), "--convert-to-signing-key")
+	_, stderr, err := ExecuteCmd(createReIssueOperatorCmd(), "--convert-to-signing-key")
 	require.NoError(t, err)
 	op3, err := ts.Store.ReadOperatorClaim()
 	require.NoError(t, err)
 	require.NotEqual(t, op2.Subject, op3.Subject)
+	require.Equal(
+		t,
+		stderr,
+		"[ OK ] operator \"O\" successfully changed identity to: "+op3.Subject+"\n"+
+			"[ OK ] old operator key \""+op2.Subject+"\" turned into signing key\n"+
+			"all jobs succeeded\n",
+	)
 	require.Len(t, op3.SigningKeys, 1)
 	require.True(t, op3.SigningKeys.Contains(op2.Subject))
Repository: rsteube/carapace (go)

Issue:
bash: ActionMultiParts sometimes removes prefix
```sh
gh issue create --label needs-investigation,p<TAB>
```

becomes
```sh
gh issue create --label p
```

Pull request:
bash: fix prefix removal
fixes #164 

Although multiple values are provided bash might insert part of it if the all have the same prefix.
But this would skip/remove the prefix of an ActionMultiParts as this are the display values and not what is intended to be inserted into the line.
To prevent this a dummy value (`_`) is added.

Patch:
diff --git a/internal/bash/snippet.go b/internal/bash/snippet.go
index 4da7e1d..96924a8 100644
--- a/internal/bash/snippet.go
+++ b/internal/bash/snippet.go
@@ -63,6 +63,7 @@ _%v_completions() {
 
   [[ $cur =~ ^[\"\'] ]] && COMPREPLY=("${COMPREPLY[@]//\\ /\ }")
   [[ ${#COMPREPLY[*]} -gt 1 ]] && COMPREPLY=("${COMPREPLY[@]#*	}") # show visual part (all after tab)
+  [[ ${#COMPREPLY[*]} -gt 1 ]] && [[ "$(printf  "%%c\n" "${COMPREPLY[@]}" | uniq | wc -l)" -eq 1 ]] && COMPREPLY=("${COMPREPLY[@]}" "_ (ignore me)") # prevent insertion if all have same first character (workaround for #164)
   [[ ${#COMPREPLY[*]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY[0]%%	*} ) # show value to insert (all before tab) https://stackoverflow.com/a/10130007
   [[ ${COMPREPLY[0]} == *[/=@:.,] ]] && compopt -o nospace
 }


Test patch:
diff --git a/example/cmd/root_test.go b/example/cmd/root_test.go
index 3aa3b56..ba312fc 100644
--- a/example/cmd/root_test.go
+++ b/example/cmd/root_test.go
@@ -267,6 +267,7 @@ _example_completions() {
 
   [[ $cur =~ ^[\"\'] ]] && COMPREPLY=("${COMPREPLY[@]//\\ /\ }")
   [[ ${#COMPREPLY[*]} -gt 1 ]] && COMPREPLY=("${COMPREPLY[@]#*	}") # show visual part (all after tab)
+  [[ ${#COMPREPLY[*]} -gt 1 ]] && [[ "$(printf  "%c\n" "${COMPREPLY[@]}" | uniq | wc -l)" -eq 1 ]] && COMPREPLY=("${COMPREPLY[@]}" "_ (ignore me)") # prevent insertion if all have same first character (workaround for #164)
   [[ ${#COMPREPLY[*]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY[0]%	*} ) # show value to insert (all before tab) https://stackoverflow.com/a/10130007
   [[ ${COMPREPLY[0]} == *[/=@:.,] ]] && compopt -o nospace
 }