-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Allow passing --remove
to cargo dev setup <SUBCOMMAND>
#8664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
r? @xFrednet (rust-highfive has picked a reviewer for you, use r? to override) |
cargo dev setup <SUBCOMMAND>
--remove
to cargo dev setup <SUBCOMMAND>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. I think that setup XYZ --remove
reads a bit weird, but I'm no UI designer, and it's worth the addition, if it helps at least one contributor.
Could you squash your commits? Afterwards, this can be merged 🙃
@xFrednet Fair enough, it might be a bit weird. I think what's throwing me off here is that it's verb noun rather than noun verb (due to the options being subcommands rather than arbitrary values) so I would possibly expect it to be You see verb noun more in cases with arbitrary values I think, e.g. That being said, it's a matter of personal preference and it may need some more thought / input from others |
I chose this order for two reasons:
I don't think that there is a right or wrong here. Alternatively, we could add a command to the Since this is an internal Clippy-specific tool, I think just adding |
@xFrednet I understand, just to clarify I didn't mean to say that the current method is wrong, just to explain why I personally saw the need to open the PR. This is possibly a silly question but since I've had some issues with this: I'm used to working with "squash and merge" or just normal commits and haven't needed to squash on my end up until now (and the previous PRs to clippy), what specifically am I expected to do when asked to squash my commits? The guides I've followed didn't really work as expected. Edit: also, it seems like this (asking to squash) is said on every PR, perhaps a bot could just post that when approving? To make reviewers' lives easier |
Hey @yoav-lavi, it's not a stupid question. I only learned about squashing from this project. 🙃 Squashing can basically combine multiple commits into one. There are a few ways to do it, and this is my way: # On your branch
git rebase -i HEAD~6 The
Now you can indicate if and how you would like to change commits. In this case, you can use
and then save and close the file. If you pick git push --force-with-lease
# I have an alias for this and other git utilities. Here is my alias, if you want it
# alias git-push='git push --force-with-lease' For a deeper understanding, I would recommend reading the documentation, but this should you though almost everything. Also note, that force pushing overwrites the remote branch. In this case, we want this, but I recommend being careful with force pushes 🙃
The goal of squashing is to create a good history. With larger PRs it makes sense to split the implementation into several well named commits. They can also help with the review, to separate old changed from new ones. It's possible to automatically squash with For me, it depends on the type of commits that are present. Here we have one well named one and several commits that just fix something. That's why I asked you to squash. But I appreciate you watching out for us 🙃 |
add missing args unque name not needed more descriptive help formatting fixes missing quote
@xFrednet thanks! I appreciate the detailed explanation. That's more or less what I've been doing using the guide I found, the problem mainly arises when pulling from master at some point, but it worked correctly on this attempt (although I tried again before seeing your message so the commit message might be a combined one rather than the first, wasn't aware of |
You're welcome! Are you referring to conflicts? Those are sadly more difficult to fix with rebasing in comparison to merging :/ . I've heard that you can just merge and then squash the merge commit. But don't quote me on that ^^ |
The changes and commit look good to me, thank you for the update and squashing the commits 🙃 @bors r+ |
📌 Commit ffde78b has been approved by |
I think the issue was mainly having X new commits that also need to be squashed, but I don't remember exactly what happened last time around. Will let you know if I notice it again. I wonder if bors could use commit impersonation to fix the issue, but the commits would not be verified (not sure if that's an issue) |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Sure, you can ping me the next time when you have a problem 🙃
That's the main thing holding this feature back. They've discussed impersonating the user, but that would mark them as unverified. I'm sadly not sure what the best solution would be. This works well enough for now 🙃 |
We should add "how to squash / rebase" instructions to our documentation. I always recommend to check the git diff with the remote branch and make sure it is empty before force pushing to the remote branch. Having an alias for force pushing is really bad style in my opinion, because it makes it easier to do by accident. My alias is |
It's definitely something that should be handled carefully. How can you add aliases for flags like that? 🙃 |
changelog: none
Allows passing
--remove
tocargo dev setup <SUBCOMMAND>
as an alternative tocargo dev remove ...
Fixes #8663