sapling
sapling copied to clipboard
`sl pr submit` overwrites PR title and description
It seems like running sl pr submit always updates the PR title and description. Is there a way to disable this behavior so it doesn't overwrite the title and description updates I make on Github? It would also be nice if sl pr submit uses the existing pull request template when creating the PR for the first time.
For context my repo has a pull request template and I usually fill out the details on github.com after creating the PR, so having sl pr submit overwrite this anytime I make changes is not ideal. I could use sl push to get around this but that doesn't handle updating the whole stack.
Currently there isn't a way of disabling this behavior or to integrate templates into this, as far as I know. Let me see what we can do about this.
Perhaps #191 could be a thing to look at at the same time, in case the changes required for this issue could also be made to support that?
I agree we should improve this, but FYI, sl pr submit rewrites your pull request body using the current contents of your commit message. If you ended up writing the changes back to your commit message, things would work out, but I realize that's annoying.
I'll see what we can do here.
This makes sapling pretty unusable. I need to edit the PR description separately from the commit message.
- Pushing a commit for every description edit is overkill, starts a new CI build, spams PR history
- I need to add stuff like screenshots and tables, this is hard to do in the terminal.
From my time at meta the way it worked was that after you updated a diff title/description in the UI, it would be "out of sync" and stop updating it when a new version was submitted. There was a hg sync command that would update your commit message with the latest UI's version as well to bring them back in sync.
@bolinfest Right now I'm running my own build with the code that updates PRs commented out. Something like I described above would be awesome. Would you be open to a stopgap solution that simply disables updating PRs after the initial creation with a config flag?
ui.update_gh_pr = false
I would be happy to contribute this
Could we get any update or action item on this? If @lazopm can contribute on this, that will be great
A --no-rewrite-body argument for submit could be also be a step towards adjusting this behavior. If that's easier as a first step. It'd make sapling much more usable. Users can alias pr submit with this argument as needed.
I've submitted #780 to propose one possible way of addressing this issue - by only updating the stack list section of the PR description while leaving the title and rest of the body intact.
Currently there isn't a way of disabling this behavior or to integrate templates into this, as far as I know. Let me see what we can do about this.
I did land https://github.com/facebook/sapling/pull/633 to allow for templates, but it requires the latest build of sapling. I also was able to use it for templates in my local extension build, but it doesnt seem to work with the real extension still yet (perhaps I could get some help debugging this by someone with more knowledge, is there a special version of sapling used by the extension?)