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

Re: [PATCH v6 1/7] pull: rename pull.rebase to pull.mode

From
RHRichard Hansen <rhansen@bbn.com>
Date
May 2, 2014, 23:51 UTC
Message-ID
<53642F9D.3040606@bbn.com>
In-Reply-To
<53640a26569a5_135215292ec43@nysa.notmuch>
On 2014-05-02 17:12, Felipe Contreras wrote:
Show 6 quoted lines
> Richard Hansen wrote:
>> Should branch.autosetuprebase be replaced with a new
>> branch.autosetupmode setting?
> 
> Maybe. But if so, I think that should be done in another series.
> Otherwise we'll never have a chance to change anything.
Sure.
Show 9 quoted lines
>>>                                  The possible values are 'merge',
>>> +	'rebase', and 'rebase-preserve'.
>>
>> While the name 'merge' is mostly self-explanatory, I think it needs
>> further clarification:  Does 'merge' imply --no-ff?  Or --ff?  Or the
>> value of merge.ff?
> 
> 'pull.mode=merge' will do the same as `git merge`, I don't see where or
> how it can be explained more clearly.
How about:
branch.<name>.pullmode::
	Determines how 'git pull' integrates the fetched branch into
	branch <name>.
	Defaults to the value of `pull.mode`.
	Supported values:
+
--
	`merge`:::
		Merge the fetched branch into <name>.
		See also `merge.ff`.
	`rebase`:::
		Find the point at which <name> forked from the fetched
		branch (see the `--fork-point` option of
		linkgit:git-merge-base[1]), then rebase the commits
		between the fork point and branch <name> onto the
		fetched branch.
	`rebase-preserve`:::
		Like `rebase` but passes `--preserve-merges` to 'git
		rebase'.
--
+
*NOTE*: `rebase` and `rebase-preserve` are potentially dangerous; do
*not* use them unless you understand the implications (see
linkgit:git-rebase[1] for details).
pull.mode::
	See `branch.<name>.pullmode`.  Defaults to `merge`.
Show 5 quoted lines
> 
>> Which side will be the first parent?
> 
> The same as things currently are: the pulled branch into the current
> branch (current branch is first parent).

This was a rhetorical question -- I was trying to point out that the current behavior should be documented.

> 
> We should probably change this, but that's out of scope of this series,
> and hasn't been decided yet.

Agreed. If this series is merged, a future series could add a 'merge-there' pull mode.

Show 8 quoted lines
>> Also, rather than copy+paste
>> the description from branch.<name>.pullmode, I'd prefer a brief
>> reference.  For example:
>>
>> pull.mode::
>>     See branch.<name>.pullmode.  Defaults to 'merge'.
> 
> I'd say pull.mode is the important one.
Either way works for me.  How about this:
branch.<name>.pullmode::
	Overrides the value of `pull.mode` for branch <name>.
pull.mode::
	Determines how 'git pull' integrates the fetched branch into
	the current branch.
	Supported values:
+
--
	`merge`:::
		(default)
		Merge the fetched branch into the current branch.
		See also `merge.ff`.
	`rebase`:::
		Find the point at which the current branch forked from
		the fetched branch (see the `--fork-point` option of
		linkgit:git-merge-base[1]), then rebase the commits
		between the fork point and the current branch onto the
		fetched branch.
	`rebase-preserve`:::
		Like `rebase` but passes `--preserve-merges` to 'git
		rebase'.
--
+
*NOTE*: `rebase` and `rebase-preserve` are potentially dangerous; do
*not* use them unless you understand the implications (see
linkgit:git-rebase[1] for details).
-Richard
Previous: Felipe ContrerasNext: Felipe Contreras
Message 6 of 18 in “Reject non-ff pulls by default”
  1. 0/7 Reject non-ff pulls by defaultFelipe Contreras, May 2, 2014
  2. 1/7 pull: rename pull.rebase to pull.modeFelipe Contreras, May 2, 2014
  3. W. Trevor KingMay 2, 2014
  4. Richard HansenMay 2, 2014
  5. Felipe ContrerasMay 2, 2014
  6. Richard HansenMay 2, 2014
  7. 2/7 pull: migrate all the tests to pull.modeFelipe Contreras, May 2, 2014
  8. 3/7 pull: refactor $rebase variable into $modeFelipe Contreras, May 2, 2014
  9. 4/7 pull: add --merge optionFelipe Contreras, May 2, 2014
  10. brian m. carlsonMay 2, 2014
  11. Felipe ContrerasMay 2, 2014
  12. brian m. carlsonMay 2, 2014
  13. Felipe ContrerasMay 2, 2014
  14. brian m. carlsonMay 2, 2014
  15. 5/7 pull: add merge-ff-only optionFelipe Contreras, May 2, 2014
  16. W. Trevor KingMay 2, 2014
  17. 6/7 pull: add warning on non-ff mergesFelipe Contreras, May 2, 2014
  18. 7/7 pull: only allow ff merges by defaultFelipe Contreras, May 2, 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.