threads / discuss / 16214

pull --preserve-merges

Subject: pull --preserve-merges

## tl;dr

6 messages between Nov 7, 2008 and Nov 10, 2008.

replies: 5people: 3as markdown or json

Stephen Haberman· Nov 7, 2008, 22:01 UTC · lore
Hi,

Awhile ago I brought up wanting to have a "rebase with preserve merges" option for `git pull`:

http://thread.gmane.org/gmane.comp.version-control.git/96513

Andreas had a patch to help by supporting manually typing out `git pull --rebase --preserve-merges`:

http://thread.gmane.org/gmane.comp.version-control.git/96593

And then I did another small copy/paste patch on top to add a config setting of `branch.<name>.preservemerges` much like the existing `branch.<name>.rebase`.

The patches haven't gotten an explicit "no" that I noticed, nor have they been applied...is there anything I can do to move them along? Resubmit them or what not?

Thanks, Stephen

Johannes Schindelin· Nov 8, 2008, 15:08 UTC · re: Stephen Haberman · lore

Re: pull --preserve-merges

Hi,
On Fri, 7 Nov 2008, Stephen Haberman wrote:
> Awhile ago I brought up wanting to have a "rebase with preserve merges"
> option for `git pull`
That might be something you want, but you cannot call it
	git pull --preserve-merges

since everybody used to "pull = fetch && merge" would go "Huh? A merge _does_ preserve merges".

If at all, you could call it "--rebase=preserve-merges".

Ciao, Dscho

Francis Galiegue· Nov 8, 2008, 17:07 UTC · re: Johannes Schindelin · lore

Re: pull --preserve-merges

Le Saturday 08 November 2008 16:08:41 Johannes Schindelin, vous avez écrit :
Show 15 quoted lines
> Hi,
>
> On Fri, 7 Nov 2008, Stephen Haberman wrote:
> > Awhile ago I brought up wanting to have a "rebase with preserve merges"
> > option for `git pull`
>
> That might be something you want, but you cannot call it
>
> 	git pull --preserve-merges
>
> since everybody used to "pull = fetch && merge" would go "Huh? A merge
> _does_ preserve merges".
>
> If at all, you could call it "--rebase=preserve-merges".
>

Why not --rebase --keep-merges? Personnally, I think it makes things clearer since in general options are either standalone or have a value.

-- 
fge
Stephen Haberman· Nov 8, 2008, 17:57 UTC · re: Francis Galiegue · lore

Re: pull --preserve-merges

Replying to both Johannes and Francis...
Show 9 quoted lines
> > > Awhile ago I brought up wanting to have a "rebase with preserve merges"
> > > option for `git pull`
> >
> > That might be something you want, but you cannot call it
> >
> > 	git pull --preserve-merges
> >
> > since everybody used to "pull = fetch && merge" would go "Huh? A merge
> > _does_ preserve merges".

Ah, right, sorry, Johannes, I know it only makes sense in the context if --rebase is also being in use, I was just being too brief.

> > If at all, you could call it "--rebase=preserve-merges".
I'd be fine with that, I had not thought of it.
> Why not --rebase --keep-merges? Personnally, I think it makes things clearer 
> since in general options are either standalone or have a value.

I originally had --rebase --preserve-merges in mind because it matches the existing -p/--preserve-merges flag that git rebase has that I'd like git pull to just pass along.

If they were separate flags, passing just --preserve-merges without --rebase should likely report an error. Probably the same thing if someone sets `branch.name.preservemerges` but `branch.name.rebase` is not set.

Unless instead of separate config parameters, `branch.name.rebase` uses Johannes's suggestion and has separate values...true or false or preserve-merges. That would probably better parallelize with the --rebase=preserve-merges style command line argument.

Between one flag/config parameter or two flags/config parameters, I could go either way and would be willing to patch together either one to get it in.

Thanks, Stephen

Stephen Haberman· Nov 10, 2008, 19:05 UTC · re: Stephen Haberman · lore

Re: pull --preserve-merges

Show 13 quoted lines
> Awhile ago I brought up wanting to have a "rebase with preserve merges"
> option for `git pull`:
>
> http://thread.gmane.org/gmane.comp.version-control.git/96513
>
> Andreas had a patch to help by supporting manually typing out `git pull
> --rebase --preserve-merges`:
>
> http://thread.gmane.org/gmane.comp.version-control.git/96593
>
> And then I did another small copy/paste patch on top to add a config
> setting of `branch.<name>.preservemerges` much like the existing
> `branch.<name>.rebase`.

I just noticed the `branch.<name>.mergeoptions` flag in the merge docs. Instead of having both `branch.<name>.rebase` and `.preservemerges`, and possibly even more config parameters for whatever other people what to configure as well, would something like `branch.<name>.pulloptions` be a better idea?

In our case, we could then set all the `branch.<name>.pulloptions` to "--rebase --preserve-merges" (likely via a post-checkout hook) and be happy with `git pull` "just working".

Adding pulloptions would make the patch a little bit trickier, for me to implement anyway, and I assume the rebase flag would have to stay for backwards compatibility, but if a pulloptions config parameter approach would be more acceptable than an explicit preservemerges config (and hence more likely to get the patches accepted), I'd be willing to work on that.

Thanks, Stephen

Johannes Schindelin· Nov 10, 2008, 19:48 UTC · re: Stephen Haberman · lore

Re: pull --preserve-merges

Hi,
On Mon, 10 Nov 2008, Stephen Haberman wrote:
Show 21 quoted lines
> [citing someone, presumably himself]
>
> > Awhile ago I brought up wanting to have a "rebase with preserve 
> > merges" option for `git pull`:
> >
> > http://thread.gmane.org/gmane.comp.version-control.git/96513
> >
> > Andreas had a patch to help by supporting manually typing out `git 
> > pull --rebase --preserve-merges`:
> >
> > http://thread.gmane.org/gmane.comp.version-control.git/96593
> >
> > And then I did another small copy/paste patch on top to add a config 
> > setting of `branch.<name>.preservemerges` much like the existing 
> > `branch.<name>.rebase`.
> 
> I just noticed the `branch.<name>.mergeoptions` flag in the merge docs.
> Instead of having both `branch.<name>.rebase` and `.preservemerges`, and
> possibly even more config parameters for whatever other people what to
> configure as well, would something like `branch.<name>.pulloptions` be a
> better idea?
Or we can stay backwards-compatible and support
	[branch "<name">]
		rebase = preserve-merges

Ciao, Dscho

← back to recent threads