Re: need help with git show :1:...
- From
Elijah Newren <newren@gmail.com>
- Date
- Apr 8, 2009, 18:25 UTC
- Message-ID
- <51419b2c0904081125u3bdf37deyd5dd85f6c2a6d7cc@mail.gmail.com>
- In-Reply-To
- <7357.1239214209@relay.known.net>
Hi,
On Wed, Apr 8, 2009 at 12:10 PM, layer <layer@known.net> wrote:
Show 18 quoted lines
> 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