git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: sverre@rabbelier.nl, Git Mailinglist <git@vger.kernel.org>,
	Miklos Vajna <vmiklos@frugalware.org>
Subject: Re: theirs/ours was Re: [PATCH 6/6] Add a new test for using a custom merge strategy
Date: Tue, 29 Jul 2008 08:36:30 -0400	[thread overview]
Message-ID: <20080729123629.GA12069@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.DEB.1.00.0807291301060.4631@eeepc-johanness>

On Tue, Jul 29, 2008 at 01:05:11PM +0200, Johannes Schindelin wrote:

> > Perhaps. But I see this as an operation on the production branch: "pull
> > in master's changes, forgetting ours".
> 
> First of all, I cannot say how wrong it is to forget any changes in a 
> production branch without proper explanation.  I.e. without a commit 
> message explaining _why_ the change was wrong to begin with.

Of course; I even mentioned the same in another part of the thread. But
that isn't a difference between "ours" and "theirs"; any time you are
discarding some changes, you should mention why.

> > In your workflow (git checkout master && git merge -s ours production && 
> > git push origin master:production) we perform an operation on master, 
> > which doesn't seem as intuitive to me.
> 
> But why?  Isn't the _content_ of "master" what we want?

Sure, which means we must _read_ from master. But you are _changing_
master. Whereas I view this as an operation on the production branch.

Please don't misunderstand me. I am not saying your way of thinking
about it is wrong (or even less right than mine). What I have been
trying to say this whole thread is that it is reasonable for a user to
model the goal as I have described, and that git can easily support the
direct implementation of achieving that goal (which is what Sverre asked
originally -- is this useful to people?).

> > Not to mention that we might not _control_ master.
> 
> This is Git.  We control all local branches.

Sort of. Consider the kernel example I gave. A "linus" branch represents
"this is where Linus is."  But that _isn't_ where Linus is if you have
added an extra merge commit to it. So either we throw away the change
made to the "linus" branch, or we forever have extra merges that Linus
does not have.

So yes, obviously you can do whatever you like with your local branches.
But you complained in my example that the "production" branch was
unnecessarily being treated as "dominant". My example was meant to
indicate that the "thrown away" branch is dominant for a reason (in this
case, it is my work branch, while the other is a tracking branch).

> No, this workflow almost _dictates_ a plain "pull" into your local branch.  
> The fact that a few commits were applied to upstream usually only means 
> that your merge succeeds trivially, since the merged branches contain the 
> _same_ changes.

I don't see the point in talking about "usually".  In the scenario in
which I used it, the merge _didn't_ succeed trivially. Of course,
usually you would not use "-s theirs". But the question was "is this
ever useful?" and my answer was "rarely, but here is an example of when
I wanted it."

If you are using "-s theirs" frequently, you are probably doing
something wrong. But that doesn't mean it is wrong for it to exist.

-Peff

  reply	other threads:[~2008-07-29 12:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-28 14:54 theirs/ours was Re: [PATCH 6/6] Add a new test for using a custom merge strategy Sverre Rabbelier
2008-07-28 18:14 ` Miklos Vajna
2008-07-28 19:48   ` Sverre Rabbelier
2008-07-28 18:56 ` Jeff King
2008-07-28 19:09   ` Johannes Schindelin
2008-07-28 19:26     ` Jeff King
2008-07-28 20:00       ` Avery Pennarun
2008-07-28 23:27       ` Johannes Schindelin
2008-07-29  0:09         ` Sverre Rabbelier
2008-07-29  4:31           ` Jeff King
2008-07-29  4:38         ` Jeff King
2008-07-29 11:05           ` Johannes Schindelin
2008-07-29 12:36             ` Jeff King [this message]
2008-07-29 12:42               ` Sverre Rabbelier
2008-07-29  0:37       ` Junio C Hamano
2008-07-29  5:02         ` Jeff King
2008-07-29  9:36           ` Mike Ralphson
2008-07-29 12:42             ` Jeff King
2008-07-28 19:52     ` Sverre Rabbelier
2008-07-28 20:07     ` Junio C Hamano
2008-07-28 20:10       ` Sverre Rabbelier
2008-07-28 20:20         ` Junio C Hamano
2008-07-28 20:24           ` Sverre Rabbelier
2008-07-28 21:16             ` Junio C Hamano
2008-07-28 21:35               ` Junio C Hamano
2008-07-28 21:39                 ` Sverre Rabbelier
2008-07-29  5:08               ` Jeff King
2008-07-29  6:35                 ` Junio C Hamano

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=20080729123629.GA12069@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=sverre@rabbelier.nl \
    --cc=vmiklos@frugalware.org \
    /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).