Skip to content

Conversation

raxod502
Copy link
Member

@raxod502 raxod502 commented Jun 13, 2025

It's finally here. Six years in the making. Closes #334. Replaces 00ee2d4 and f18e581. Fully compatible with the new process management API. Handles stdout and stderr properly.

Use (setq straight-display-subprocess-prompts t) to opt in and test it out.

image

@raxod502 raxod502 merged commit f72451d into develop Jun 13, 2025
6 checks passed
@raxod502 raxod502 deleted the rr-ssh-prompts branch June 13, 2025 18:06
@raxod502
Copy link
Member Author

@progfolio Big news!

@progfolio
Copy link
Contributor

Cool!
Tested it out with a private repo of mine.
First run I got a git command failure, but once I explicitly specified a :branch in the recipe everything worked fine.

@raxod502
Copy link
Member Author

Huh, why would it fail without :branch? It should use the default branch in that case, no?

@progfolio
Copy link
Contributor

progfolio commented Jun 14, 2025

Apologies. It looks like the repository does clone, but a warning is generated:

⛔ Warning (straight): Could not check out branch "[email protected]:progfolio/tunic.git" of repository "tunic"

process log output:

Enter passphrase for key '/home/n/.ssh/id_ed25519': ********
* remote origin
  Fetch URL: [email protected]:progfolio/tunic.git
  Push  URL: [email protected]:progfolio/tunic.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)

[Return code: 0]

$ cd /tmp/straight.test/straight/repos/tunic/
$ git checkout -B git\@github.com\:progfolio/tunic.git origin/git\@github.com\:progfolio/tunic.git

fatal: 'origin/[email protected]:progfolio/tunic.git' is not a commit and a branch '[email protected]:progfolio/tunic.git' cannot be created from it

[Return code: 128]

My hunch is that straight-vc-git--default-remote-branch is returning the wrong info.
I'll step through it to see if that's the case.

@raxod502
Copy link
Member Author

raxod502 commented Jun 14, 2025

Huh, yeah, that's completely bricked. It thinks the remote URL is a branch name. Could be an issue where the output format changes when Git thinks it can talk to stdin, which also caused an issue when I was listing branches (d036862).

Looking at your process buffer output something looks scuffed there, I suspect this is the issue and you have found a bug. I will check on it further.

@raxod502
Copy link
Member Author

Ahaha! I know what the issue is. Look at this code:

straight.el/straight.el

Lines 3018 to 3022 in 148611e

(straight--process-with-result
(straight--process-run "git" "remote" "show" remote)
(when success
(replace-regexp-in-string ".*: \\(.*\\)$" "\\1"
(nth 3 (split-string stdout "\n")))))))))

It's checking the 4th line of the git remote show output to look for the default branch. If you look at your output you can see that's about right, except you had to do ssh authentication, so that is an extra line.

The answer is to do more robust parsing, of course. I'll update the command that this is using.

@progfolio
Copy link
Contributor

That makes sense. The stdout could be offset by multiple lines, too, in the case of a retry after a bad password.

@raxod502
Copy link
Member Author

That should be fixed in #1212.

@progfolio
Copy link
Contributor

That should be fixed in #1212.

Confirmed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants