-
-
Notifications
You must be signed in to change notification settings - Fork 800
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
Allow setting --rebase=<arg> in magit-pull transient #3938
Comments
--rebase=false
argument in magit-pull
transient--rebase=<arg>
in magit-pull
transient
--rebase=<arg>
in magit-pull
transient
Why don't you just commit the merge after you have resolved the conflicts? How does aborting and then merging preserve the conflict resolution and how does aborting and then pull-rebasing fail to do the same? I am guessing that you have left out some crucial detail and/or I am misunderstanding completely.
IMO performing the merge/rebase in a step separate from the fetch step is always a good idea.
If I understand correctly you would like to use Okay so I probably would not use Unfortunately (for you) there are a few other complications. Replacing the switch Additionally this is a prime example of a setting that can be controlled using either an argument or a configuration variable (several such variables actually). As described in #2993 I intend to rething such settings but doing so is far from trivial. I fear that if I implemented something at this time that I would later have to change it in backward incompatible way that would inconvenient users of the intermediate implementation. But here's an implemenation you can add to your init file: (define-infix-argument magit-pull:--rebase ()
:description "Whether to rebase and how"
:class 'transient-option
:argument "--rebase="
:reader (lambda (prompt _initial-input _history)
(magit-read-char-case "--rebase= " nil
(?f "[f]alse" "false")
(?t "[t]rue" "true")
(?m "[m]erges" "merges")
(?p "[p]reserve" "preserve")
(?i "[i]nteractive" "interactive"))))
(transient-replace-suffix 'magit-pull "-r" '("-r" magit-pull:--rebase)) Once I get around to #2993 I will likely look at this argument again. Until then I have no plans to add something like the above, so I am closing this issue. |
Setting |
@tarsius My use-case is, I did a merge with many conflicts (and it took me hours), committed the merge but then I cannot push because someone pushed in between. With my default setting But I understand that this might be an edge case where it's not justified to make the interface less comfortable and I can easily live with @npostavs Yes, rerere might do the trick but I'm too frightened to enable it. How does it know that a resolution is correct? I mean, on branch A a different resolution might be correct than on branch B. If there was a knob to make it suggest resolutions instead of just applying them, I'd feel more comfortable. |
It just goes by diff hunks. So if you happened to have identical hunks that should be resolved differently, then yes, it could make a mistake. But you know it's possible for the automatic merge of non-conflicting hunks and files to be mistaken too (e.g., one side changes the function name, another side still uses the old name elsewhere), right?
Quoting man git-rerere:
I'm not sure what "make it suggest resolutions" means vs what it already does: apply and allow you to review before staging. |
@npostavs You are right, thanks for explaining. I think, I'll try it out. :-) |
In my
.gitconfig
I havebut sometimes (when I just did a merge with many conflicts), I don't want to pull-rebase (because that would mean I need to resolve the conflicts again).
Of course, I can fetch and merge explicitly but I'd rather prefer if I could set the
git pull --rebase
argument explicitly in the pull transient (I think that used to be possible in an older Magit version). Right now, the transient just allows to provide--rebase
or not but not--rebase=false|true|merges|preserve|interactive
.The text was updated successfully, but these errors were encountered: