-
Notifications
You must be signed in to change notification settings - Fork 373
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
Rebasing (and some other operations) is confusing for hidden commits #4544
Comments
Actually, my confusion about Conversely, if we are OK with this kind of inconsistency in behavior, there is no problem with having |
Sounds good to me. I'm not pretty sure if
I don't think |
#555 about reporting new divergent changes is also relevant. Such a warning might be sufficient in many cases. |
IIUC, you are saying that Your second point, IIUC, is that Additionally, this might be obvious, but I'll say explicitly that I'm not sure what, if anything, to do about this. It could be argued that the inconsistency doesn't practically confuse many people. |
It would certainly help. There is an additional issue with Update: Speaking more positively, |
[not recommending this] One consistent solution is that Then I thought I'd mention it for discussion purposes since it's theoretically nice, but in practice I don't think it's workable —
Does it work to just restrict revsets to only ever evaluating to visible commits (and warn for certain cases, like where the entire revset value to an operation is hidden commits, or when
Does Mercurial do anything instructive when it comes to addressing hidden/obsolete commits? git-branchless has what's effectively a hidden modifier (via a |
It's at least defined consistently, One thing we could add (and is potentially useful I think) is
Mercurial works that way by default (by design.) However, it was inconvenient and they later added |
I see, this makes a lot of sense, and I didn't realize that before (well, forgot more likely). Thanks for pointing it out! I think things are clearer for me now. Interestingly (and somewhat counterintuitively, but I think correctly) this means that It might make sense to implement I see your point that
For @arxanas 's point, if we did want to have two or more different behaviors for
|
Why is the latter more powerful? |
I think it's syntactic issue. BTW, |
I meant that you could combine both expressions for the current operation and expressions for an old operation in the same revset if it was a function. |
It is confusing what should happen when
jj rebase
-ing a hidden commit. (Optional TODO: Investigate what exactly does happen currently. My testing so far is sufficient only to say "weird things happen". In fact, this might be a good way to stress-testjj
's rebasing infra and unearth some bugs).With the current behavior as I understand it,
jj rebase -r hidden_commit
should create a visible commit. This will create divergence if there is already a visible commit with the same change id.jj rebase -s hidden_commit
is even more confusing. Currently,jj rebase -s visible_commit
only rebases visible descendants ofvisible_commit
.hidden_commit
will never have visible descendants. So, eitherjj rebase -s hidden_commit
will be pretty useless or it will be fundamentally different fromjj rebase -s visible_commit
.jj rebase -b
is at least as confusing asjj rebase -s
.Proposal
Here is one proposal on how this could be resolved (alternative proposals are welcome):
jj duplicate
instead ofjj rebase -r hidden_commits
jj duplicate -d
#3518 as well asjj duplicate --before/--after
from FR: Add--insert-before
and--insert-after
tosplit
,new
,duplicate
, etc. #3772, and most other rebase options.jj duplicate -s
orjj duplicate -b
for hidden commits unless we figure out a reasonable behavior and a need for it.jj duplicate -s visible_commit
may or may not be worth doing, that's outside the scope of this issue.Open questions for this proposal:
jj simplify-parents
from simplify-parents: add a command to remove redundant parents #4492 is similar.check_rewriteable
returnfalse
for hidden commits? That would be one possible answer to the previous question, though there may need to be exceptions.The text was updated successfully, but these errors were encountered: