public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: Jay Soffian <jaysoffian@gmail•com>, git <git@vger•kernel.org>
Subject: Re: How to selectively recreate merge state?
Date: Thu, 10 Dec 2009 16:28:50 -0800 (PST)	[thread overview]
Message-ID: <m38wdae4k4.fsf@localhost.localdomain> (raw)
In-Reply-To: <7v8wda8jg3.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox•com> writes:

> Jay Soffian <jaysoffian@gmail•com> writes:
> 
> > Let's say you initiate a merge:
> >
> > $ git merge topic
> >
> > And this merge results in conflicts in two files, foo and bar. You
> > resolve the conflicts in both files, but then decide you don't like
> > how you resolved bar.
> >
> > How do you set the index and working-copy back to the state it was
> > immediately after doing the merge for bar, while leaving the merge
> > resolution alone for foo?
> 
> Before you "git add bar", you can say "git checkout --conflict=merge bar"
> (or --conflict=diff3).

Or (if I understand manpage correctly) just "git checkout --conflict bar".
 
> After "git add bar", you can't.  Save what you have resolved so far in a
> separate file (e.g. "cp foo foo.resolved"), reset to the previous state
> and redo the merge.

Hmmm... isn't it what "git update-index --unresolve bar" is for?

  --unresolve::
        Restores the 'unmerged' or 'needs updating' state of a
        file during a merge if it was cleared by accident.

Unless "git add foo" not only adds current contents of foo at stage 0,
but also removes higher stages from index...

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2009-12-11  0:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-10 23:56 How to selectively recreate merge state? Jay Soffian
2009-12-11  0:04 ` Junio C Hamano
2009-12-11  0:28   ` Jakub Narebski [this message]
2009-12-11  1:11     ` Junio C Hamano
2009-12-11  1:33       ` Jakub Narebski
2009-12-11 10:44         ` Michael J Gruber
2009-12-11 11:09           ` Björn Steinbrink
2009-12-11 12:51             ` Thomas Rast
2009-12-11 11:20           ` Jakub Narebski
2009-12-11 12:33             ` Michael J Gruber
2009-12-11 14:00               ` Jakub Narebski
2009-12-11 14:57                 ` Michael J Gruber
2009-12-11 15:35                   ` Junio C Hamano
2009-12-11 19:24                 ` Junio C Hamano
2009-12-11 22:18                   ` Jay Soffian
2009-12-11 23:46                     ` Junio C Hamano
2009-12-12  9:02                       ` [PATCH 0/3] Update advice in commit/status output Junio C Hamano
2009-12-12  9:02                         ` [PATCH 1/3] commit/status: check $GIT_DIR/MERGE_HEAD only once Junio C Hamano
2009-12-12  9:02                           ` [PATCH 2/3] commit/status: "git add <path>" is not necessarily how to resolve Junio C Hamano
2009-12-12  9:02                             ` [PATCH 3/3] status/commit: do not suggest "reset HEAD <path>" while merging Junio C Hamano
2009-12-12  9:15                             ` [PATCH 2/3] commit/status: "git add <path>" is not necessarily how to resolve Jeff King
2009-12-12  9:24                               ` Junio C Hamano
2009-12-12  9:19                             ` Nanako Shiraishi
2009-12-12 16:13                         ` [PATCH 0/3] Update advice in commit/status output Sverre Rabbelier
2009-12-12 18:27                           ` Junio C Hamano
2009-12-12 22:06                         ` Jay Soffian
2009-12-11 20:38             ` How to selectively recreate merge state? Paolo Bonzini
2009-12-11 21:14               ` 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=m38wdae4k4.fsf@localhost.localdomain \
    --to=jnareb@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=jaysoffian@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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