From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: Pavel Roskin <plroskin@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: git-rebase produces incorrect output
Date: Sat, 30 Nov 2019 09:58:11 -0800 [thread overview]
Message-ID: <xmqqa78d2qmk.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CABPp-BGiu2nVMQY_t-rnFR5GQUz_ipyEE8oDocKeO+h+t4Mn4A@mail.gmail.com> (Elijah Newren's message of "Fri, 29 Nov 2019 20:22:37 -0800")
Elijah Newren <newren@gmail.com> writes:
> Sadly, I tried to force this with git rebase, but -C5 only affected
> the apply side and there's no option to pass to rebase to pass through
> -U5 to the diff logic. Also, although there is a diff.context config
> option, git-am ignores it (Note that git_am_config() does not directly
> check that value and it calls git_default_config(), not
> git_diff_ui_config() or even git_diff_basic_config()).
Not essential but puzzled. The context applies to the generation
side, not acceptance side, no? IOW, I suspect that you are talking
about "git format-patch" that sits on the upstream side of the pipe
that feeds "git am".
> So, to summarize here:
> * you have a case where the default 3 lines of context mess stuff
> up; but rebase --merge works great
> * am doesn't have a -U option, and ignores the diff.context setting,
> making it impossible to force the am backend to work on your case
> and also:
I do not think it is super hard to teach "git rebase" to pass
backend specific options so that "git rebase--am" can be told to
work with wider context (which will reduce the risk of ambiguous
patch like this example, trading the increased risk of unnecessary
conflicts; it is a good trade-off most of the time for added safety,
as nobody wants a system that produces a wrong result silently and
quickly).
Having said that,
> * rebase doesn't have an option to use the merge/interactive backend
> by default (nor an --am option to override it)
I think addition of rebase.backend would be a good first step for
eventually flipping the default, which by the way I have no trouble
with.
> Maybe we should just switch the default, for everyone? (And provide
> an --am option to override it and a config setting to get the old
> default?)
Yes, that would be a sensible second step. I actually think a
longer term goal is to deprecate the am backend. It was invented
first and then kept to be the default backend for a long time
because the merge based backend historically has been noticeably
slow (it was expected to be---it was essentially a shell script that
run cherry-pick repeatedly in a loop). In some future, it would
outlive its usefulness, and that I think that that future is just
around the corner.
prev parent reply other threads:[~2019-11-30 17:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 8:21 git-rebase produces incorrect output Pavel Roskin
2019-11-29 13:31 ` Philip Oakley
2019-11-29 21:28 ` Pavel Roskin
2019-11-30 4:22 ` Elijah Newren
2019-11-30 16:37 ` Elijah Newren
2019-11-30 17:58 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa78d2qmk.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
--cc=plroskin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).