facebook / sapling

A Scalable, User-Friendly Source Control System.
https://sapling-scm.com
GNU General Public License v2.0
6.07k stars 275 forks source link

`sl pr unlink` does not seem to do anything #940

Open zjijz opened 3 weeks ago

zjijz commented 3 weeks ago

I was suggested to use sl pr unlink when trying to run sl pr submit when the associated GitHub PR had already been closed. I then attempted that, but it didn't seem to change the sl state at all.

This was on the macOS version installed by brew.

% sl version
Sapling 0.2.20240718-145624+f4e9df48
(see https://sapling-scm.com/ for more information)

This was the latest version available through brew (previously called brew upgrade sapling).

sl, sl pr unlink, sl (on the base commit bcc265a08):

% sl
  o  993234c71  15 minutes ago  greg
  │  xtask: Convert structopt to using clap
  │
  @  bcc265a08  15 minutes ago  greg  #13
╭─╯  Update .committemplate to repo
│
o  753ebd9e9  26 minutes ago  remote/main
% sl pr unlink
% sl  
  o  993234c71  15 minutes ago  greg
  │  xtask: Convert structopt to using clap
  │
  @  bcc265a08  15 minutes ago  greg  #13
╭─╯  Update .committemplate to repo
│
o  753ebd9e9  26 minutes ago  remote/main

sl pr submit still fails after this with the same error as before and offers the same guidance to use sl pr unlink.

I tried installing sl from brew at --HEAD, but that version is giving me issues:

% sl
unknown python exception%    
bolinfest commented 2 weeks ago

Based on the output of sl, it does not appear that Sapling knows anything about the relationship between your commit and a GitHub PR. If it did, you would see #123 after the commit title.

zjijz commented 2 weeks ago

This was for commit bcc265a08, which has #13 after it. I just pasted the entire sl tree, but it's just referencing the bottom commit.

bolinfest commented 1 week ago

@zjijz what if you use -r explicitly: sl unlink -r bcc265a08?

Though I admit the docs for sl pr unlink imply it should operate on the current commit by default.

zjijz commented 4 days ago

That was it! sl pr unlink -r . worked.

Can I make a request that pr unlink is updated to work implicitly with the current commit like pr submit or that a warning is added if there is no implicit default commit and sl pr unlink is called with no commit hashes?