git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] rebase: introduce "rebase.preserve" configuration option

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2014, 22:39 UTC
Message-ID
<xmqq61i6o92k.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1407271714-1624-1-git-send-email-ralf.thielow@gmail.com>
Ralf Thielow <ralf.thielow@gmail.com> writes:
Show 5 quoted lines
> There are several ways to configure Git to preserve merges.
> There is "pull.rebase=preserve" for all branches and
> "branch.<name>.rebase=preserve" for individual branches.
> However, there is no configuration option to preserve merges
> for all branches when running git-rebase.

How should this interact with pull.rebase? Specifically, what should happen with these settings?

	[rebase] preserve = true
        [pull] rebase = true

Historically, the variable was a way to tell 'pull' to use 'rebase' to integrate (if true) or use 'merge' to integrate (if false), and then the third value that is clearly not 'false' was added to say "How should the underlying 'rebase' integrate the local and the remote histories?".

In that light, one can argue 'git pull' with the above two should run 'rebase --preserve'. In other words, rebase.preserve tells us "When 'rebase' is told to run, it should do the 'preserving' variant."

But then when somebody sets pull.rebase to true, expecting that 'true' does not just mean "Yup, please use rebase, I do not like merges", but means "Use rebase without preserve", it would be hard to debug if the behaviour of 'git pull' is affected by a separate variable rebase.preserve that may be defined in a far-away place in the configuration file.

I dunno. This kind of complications is one reason why I wouldn't encourage adding these configurations to affect the behaviours of commands.

Previous: Ralf Thielow
Message 2 of 2 in “rebase: introduce "rebase.preserve" configuration option”
  1. rebase: introduce "rebase.preserve" configuration optionRalf Thielow, Aug 5, 2014
  2. Junio C HamanoAug 5, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.