Git Mailing List Archive on
 help / color / Atom feed
From: Junio C Hamano <>
To: Elijah Newren <>
Cc: Pavel Roskin <>,
	Git Mailing List <>
Subject: Re: git-rebase produces incorrect output
Date: Sat, 30 Nov 2019 09:58:11 -0800
Message-ID: <> (raw)
In-Reply-To: <> (Elijah Newren's message of "Fri, 29 Nov 2019 20:22:37 -0800")

Elijah Newren <> 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

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

> 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.

      parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29  8:21 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Mailing List Archive on

Archives are clonable:
	git clone --mirror git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ \
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone