git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: layer <layer@known.net>
Cc: git@vger.kernel.org
Subject: Re: need help with git show :1:...
Date: Wed, 8 Apr 2009 12:25:35 -0600	[thread overview]
Message-ID: <51419b2c0904081125u3bdf37deyd5dd85f6c2a6d7cc@mail.gmail.com> (raw)
In-Reply-To: <7357.1239214209@relay.known.net>

Hi,

On Wed, Apr 8, 2009 at 12:10 PM, layer <layer@known.net> wrote:
> Elijah Newren <newren@gmail.com> wrote:
>>> On Wed, Apr 8, 2009 at 12:02 PM, layer <layer@known.net> wrote:
>>> > quadra% git ls-files -s src/c/sock.c
>>> > 100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0       src/c/sock.c
>>>
>>> That suggests that the file is not unmerged, i.e. that there aren't
>>> any remaining conflicts.  This explains why your commands wouldn't
>>> work unless you used stage 0 instead of 1 or 2.  Now, why there
>>> weren't conflicts when you thought there were?  I have no idea, unless
>>> perhaps you did a stray git add src/c/sock.c.
>
> It was several of weeks ago that I started this merge, and I remember
> playing with git show then and it worki.  I might have overwriten
> the file with one of the show's and done manual editing that way.  I
> don't know if this makes a difference.
>
> How can I redo the merge for just this file?  Is that possible?  I
> think I'd definitely like to start over on *just this one file*.

Well, someone else probably knows a clever way to do this.  I don't,
but the following may help:

MERGE_REF=$(cat .git/MERGE_HEAD)
git show HEAD:src/c/sock.c > current-sock
git show $MERGE_REF:src/c/sock.c > other-sock
git show $(git merge-base $MERGE_REF HEAD):src/c/sock.c > base-sock
git merge-file current-sock other-sock base-sock

That'll redo the three way merge on src/c/sock.c (assuming no renames
or other special cases happened) and store the result in current-sock.
 You can then edit that file and when ready, move the result over
src/c/sock.c.

Elijah

  reply	other threads:[~2009-04-08 18:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 17:41 need help with git show :1: layer
2009-04-08 17:58 ` Elijah Newren
2009-04-08 18:02   ` layer
2009-04-08 18:07     ` Elijah Newren
2009-04-08 18:10       ` layer
2009-04-08 18:25         ` Elijah Newren [this message]
2009-04-08 18:35           ` layer
2009-04-08 18:38             ` Elijah Newren
  -- strict thread matches above, loose matches on Subject: below --
2009-04-08 17:57 layer

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=51419b2c0904081125u3bdf37deyd5dd85f6c2a6d7cc@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=layer@known.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 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 NNTP newsgroup(s).