-
Notifications
You must be signed in to change notification settings - Fork 360
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
lakeFS allows merging a branch to itself #7824
Comments
Why is this a problem? You said "allow empty" so shouldn't it allow the action??? |
Since we're checking if the content of the two branches is different, adding the "allow-empty" flag introduces the option to |
I have a question about desired output of lakectl when trying to merge a branch to itself. Currently, my PR changes the server only, and the output of lakectl is:
Should the "400 Bad Request" line appear? it seems to expose implementation details unnecessarily, especially since we already have a descriptive error message. I checked the output in a similar case where the server returns an error response - trying to make an empty commit without the "allow empty" flag. In this case the output also shows the Bad Request line.
I believe the output should be consistent in both cases, but from the same reason I think this line should not appear on both. |
Personally I believe that it should: unlike unformatted error text, an http code is an unambiguous specification. If you disagree, we could discuss on Slack or on a separate issue. |
I talked to @ozkatz , here's his suggestion: do what Git does in this situation. I'll check and update here. |
What Git doesThis is actually impossible on Git! Git fails any merge from an ancestor of the branch HEAD, with the message " For instance: ❯ git log
commit bcf5a09671562551797fa747c43d9f86e5b30aef (HEAD -> main)
Author: Ariel Shaqed (Scolnicov) <[email protected]>
Date: Thu Dec 5 19:57:07 2024 +0200
[...]
commit b5aa1a1b17a8bfb4d55f37e1d8a0395fb96773d5
Author: Ariel Shaqed (Scolnicov) <[email protected]>
Date: Thu Dec 5 19:45:40 2024 +0200
[...]
❯ git merge main~
Already up to date.
❯ git merge b5aa
Already up to date.
❯ git merge main
Already up to date. ProposalDo what Git does: forbid the merge if a commit is an ancestor of the branch head. This has multiple advantages:
|
After recently allowing merge using the "allow_empty" or "force" flags (#7798), it allows users to merge a branch into itself.
For example -
Create
branch 1
, branchbranch 2
frombranch 1
, and mergebranch 2
intobranch 1
.Previously it would result in a
no changes
error,And now, when merging using the "allow_empty" or "force" flags, it's possible to complete this merge.
The text was updated successfully, but these errors were encountered: