All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Neal Kreitzinger <nkreitzinger@gmail.com>,
	git@vger.kernel.org
Subject: Re: who's on first? - following first parent and merge-management
Date: Thu, 08 Mar 2012 09:03:32 +0100	[thread overview]
Message-ID: <4F5867D4.1010904@viscovery.net> (raw)
In-Reply-To: <20120308071403.GE7643@sigill.intra.peff.net>

Am 3/8/2012 8:14, schrieb Jeff King:
> What if the user could specify a partial ordering of refs, and we used
> that order when listing merge parents in the resulting commit. So for
> example, if you said that:
> 
>   refs/remotes/origin/master > refs/heads/master
> 
> then doing:
> 
>   $ git checkout master
>   $ git pull origin master
> 
> would result in a "flipped" merge commit, with origin/master as the
> first parent, and master as the second.

I have wished for such a thing several times already.

It happens when I have a topic with changes that trigger a complete
rebuild of the project. When I merge it to master, I have to

   # on topic
   git checkout master   #1
   git merge topic       #2

#1 triggers a rebuild, but I don't do a build. Then #2 again triggers a
rebuild, but in reality the only changes since the last build are those
from master since the topic forked (no, I can't use ccache).

To avoid the situation, I jump through hoops by preparing an index and
worktree with the merge result while I am on topic:

   # on topic
   git checkout --detach
   git merge master      # triggers rebuild of only master's changes
   # merge result ready; carry it over to master and repeat the merge
   git reset --soft master
   git checkout master
   git merge topic       # fails if content merge is necessary
   git checkout master -- file/needing/content/merge # (*)
   git merge topic       # now succeeds

This would not be necessary if the order of the merge parents could be
specified, e.g.:

   # on topic
   git merge --into master

(*) Jumping through these hoops make sense only if
file/needing/content/merge is _not_ the one that triggers the complete
rebuild.

-- Hannes

  parent reply	other threads:[~2012-03-08  8:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07  5:36 who's on first? - following first parent and merge-management Neal Kreitzinger
2012-03-07  7:37 ` Junio C Hamano
2012-03-08  6:13   ` Junio C Hamano
2012-03-08  7:14     ` Jeff King
2012-03-08  7:38       ` Junio C Hamano
2012-03-08  8:03       ` Johannes Sixt [this message]
2012-03-08 17:30         ` Junio C Hamano
2012-03-09 12:05           ` Holger Hellmuth
2012-03-09 12:29             ` Johannes Sixt
2012-03-09 13:25               ` Holger Hellmuth
2012-03-09 16:26                 ` Junio C Hamano
2012-03-08  7:49     ` Jonathan Nieder
2012-03-08 22:52       ` 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

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

  git send-email \
    --in-reply-to=4F5867D4.1010904@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nkreitzinger@gmail.com \
    --cc=peff@peff.net \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.