-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add a --use-destination-message option to jj squash
#3427
Conversation
I feel like |
5a9bacd
to
b94c721
Compare
Maybe |
I don't really care what we call it as long as there's a short flag for it. The problem with Do you think |
You also need to run |
b94c721
to
fdf3766
Compare
I think it sounds like an unusual use case that you have described two commits in different ways and now you want no part of either of the descriptions to apply to the combination. It seems like it would be much more common that one of the descriptions is still close to correct. |
Works for me. The latter would have to be an error if there are multiple sources, I suppose. Or maybe it means that you want a combination of them? Maybe the flags should instead be |
What's the best default for the message? |
Oh sorry Martin. This feature does NOT drop all messages, it only drops the source messages. Maybe the flag should be called I agree that |
Ah! I think I read "the descriptions of the commits being squashed are dropped" and missed "and the message of the destination commit is used". Sorry! I do think |
I do feel like it's better to talk about what message is being kept. That's the message I'd be thinking about when I use this option. So, I still prefer I'd also like |
If we want "keep" instead of "drop", we should probably say "use" instead of "keep" since it makes it a little clearer that the other messages are dropped. If we went with IMO the proposed names are hard to abbreviate. There's a bit less symmetry, but what about |
That sounds like a good idea to me. :)
How about aliases I think you are right that these are harder to abbreviate, but I think we could live with that (or we might come up with an even better idea).
This has the problem that it'll be hard to remember whether -u uses the source message or the destination message. In fact, since it's more common, I would expect --use-destination-message. |
If at all possible I would really like to have a two character (i.e. dash and letter) flag for this. For my workflow at least I almost always only keep the destination description. I actually don't really care about having a flag to keep only the source description, but maybe other people routinely squash commits that way. Let's sit on it for a few days and see if we can come up with names that everyone's happy with. |
The Git equivalent is probably to format the squashed commit specially (so that "fixup!" appears in its commit message - usually through "git commit --fixup") and then rebase with the config variable |
@ilyagr I just realized there is a What do you think? |
We could support that also.
I'd prefer Other than that, my thoughts are a little scattered at the moment. First, I should say that IMO this whole discussion is IMO about a slight improvement to an already good idea, not an urgent fix to some terrible problem with this PR. I was previously thinking of either getting rid of I think your plan (and/or this PR as-is, maybe with the option renamed) would be fine, especially since you seem to feel strongly about it. I'd still prefer Another thought, similar to your suggestion in #3427 (comment): we could start with Again, I don't mean that we absolutely have to implement Anyway, I think I'm thinking in circles now. Let's see if one of us, or somebody else, has some ideas. If not, as I said above, we can just go with what you have, maybe with the option renamed. |
I think I'm totally fine with If that works for everyone let's do it. |
I tried this: [profile.dev.package."*"]
opt-level = 3 It increased the build time from 39s to 49s and reduces test time with |
fdf3766
to
3695461
Compare
Sounds great! But maybe you meant to comment this somewhere else XD? Anyways, I updated this PR and it's ready for another look. |
e9a20d9
to
52cf375
Compare
jj squash
4716ba8
to
bd2b589
Compare
@ilyagr @martinvonz How do you feel about the new flag name |
Wouldn't the destination message be the default? |
The current default is to open an editor that contains the messages from every commit that's been squashed including the destination commit. |
I'm OK with it, and we haven't seen any strong objections. I think this just needs somebody (me or somebody else) to give this another look over and actually approve it. |
bd2b589
to
40773c9
Compare
@martinvonz if there are no objections I'd love to see this in the next release. Would you mind taking another look? |
Sure, will do. I've been on vacation since Wednesday. |
Sorry, I didn't know. Enjoy!! |
40773c9
to
e9b9cf3
Compare
if `--use-destination-message/-u` is passed to `jj squash`, the resulting revision will use the description of the destination revision and the description(s) of the source revision(s) will be discarded.
e9b9cf3
to
ca58ecd
Compare
Oh, it was a short vacation. I'm already back :) Though it's still weekend, which means I try to spend my days with my family instead. I'm back to work tomorrow. |
If
-d/--drop-message
is passed tojj squash
, the descriptions of the commits being squashed are dropped and the message of the destination commit is used.This is useful since I often find myself squashing a commit with a non-empty placeholder name such as "WIP: do something" or even "SQUASH: some change". Without this option
jj squash
always opens the diff editor and I need to navigate to the bottom of the description to remove the placeholder description. This is annoying and error-prone, and sometimes I accidentally leave something from the message that I wanted to discard.I'm not tied to the name
--drop-message
, but I think that whatever name we use should have a short version as well. I also considered--abandon-message/-a
, which might be better since it avoids ambiguity about whether-d
means destination.