git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Andreas Ericsson <ae@op5.se>
Cc: "Randal L. Schwartz" <merlyn@stonehenge.com>, git@vger.kernel.org
Subject: Re: I want "fast forward my workdir to upstream if it's safe"
Date: Fri, 8 May 2009 03:01:19 -0400	[thread overview]
Message-ID: <20090508070119.GA12989@coredump.intra.peff.net> (raw)
In-Reply-To: <4A03D6E2.2050708@op5.se>

On Fri, May 08, 2009 at 08:53:22AM +0200, Andreas Ericsson wrote:

>> (2b) is a bit harder, but do-able:
>>
>>   git diff-tree --name-only HEAD $upstream | sort >them
>>   (git diff-files --name-only; git diff-index --name-only) | sort >us
>>   test -z "`comm -12 us them`"
>>
>> (2c) is the trickiest (and of course, therefore probably the one you
>> want ;) ).  I'm not sure there is a simple way to do it short of hacking
>> git-merge to actually try the merge and roll it back. Because you really
>> have to deal not just with merging actual text file content but with
>> custom merge drivers.
>>
>
> The "rolling back" part is about as simple as
> * never touch the worktree (only use in-index merge)
> * preserve the last HEAD commit object name
> * preserve the index

If you are just doing in-index merge, then (2b) works fine. You know you
aren't doing any file-level merging. The advantage of (2c) is that
non-conflicting merges in files would are "safe".

-Peff

  reply	other threads:[~2009-05-08  7:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07 21:40 I want "fast forward my workdir to upstream if it's safe" Randal L. Schwartz
2009-05-07 23:18 ` Wincent Colaiuta
2009-05-07 23:20   ` Randal L. Schwartz
2009-05-08  2:30 ` Jeff King
2009-05-08  6:53   ` Andreas Ericsson
2009-05-08  7:01     ` Jeff King [this message]
2009-05-08 12:34   ` Eyvind Bernhardsen
2009-05-08 14:02     ` Randal L. Schwartz
2009-05-08 15:57     ` Junio C Hamano
2009-05-08 16:15       ` Jakub Narebski
2009-05-11 20:11       ` Eyvind Bernhardsen
2009-05-08 21:34     ` Miles Bader

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=20090508070119.GA12989@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=merlyn@stonehenge.com \
    /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).