threads / discuss / 15755

update-index --unresolve

Subject: update-index --unresolve

## tl;dr

4 messages between Oct 2, 2008 and Oct 2, 2008.

replies: 3people: 2as markdown or json

SZEDER Gábor· Oct 2, 2008, 13:52 UTC · lore
Dear All,
the documentation says following:
  --unresolve::
         Restores the 'unmerged' or 'needs updating' state of a
         file during a merge if it was cleared by accident.
How could I clear those states by accident (or intentionally)?

Thanks, Gábor

Jakub Narebski· Oct 2, 2008, 13:58 UTC · re: SZEDER Gábor · lore

Re: update-index --unresolve

SZEDER Gábor <szeder@ira.uka.de> writes:
Show 9 quoted lines
> Dear All,
> 
> the documentation says following:
> 
>   --unresolve::
>          Restores the 'unmerged' or 'needs updating' state of a
>          file during a merge if it was cleared by accident.
> 
> How could I clear those states by accident (or intentionally)?

"git add <file>", or "git update-index <file>", or error in handling merge tool via git-mergetool.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
SZEDER Gábor· Oct 2, 2008, 14:18 UTC · re: Jakub Narebski · lore

Re: update-index --unresolve

Hi Jakub,
On Thu, Oct 02, 2008 at 06:58:41AM -0700, Jakub Narebski wrote:
Show 9 quoted lines
> SZEDER Gábor <szeder@ira.uka.de> writes:
> >   --unresolve::
> >          Restores the 'unmerged' or 'needs updating' state of a
> >          file during a merge if it was cleared by accident.
> > 
> > How could I clear those states by accident (or intentionally)?
> 
> "git add <file>", or "git update-index <file>", or error in handling
> merge tool via git-mergetool.
Thanks for your fast reply.
However:

# ... do a conflicting merge (master|MERGING)$ echo 4 >one (master|MERGING)$ git status one: needs merge # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working # directory) # # unmerged: one # no changes added to commit (use "git add" and/or "git commit -a") (master|MERGING)$ git add one (master|MERGING)$ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: one # (master|MERGING)$ git update-index --unresolve (master|MERGING)$ echo $? 0 (master|MERGING)$ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: one #

So, as you can see, after 'add ; update-index --unresolve' the file is not marked as unmerged, but it's still ready to be committed.

Is something wrong going on here, or it is indeed the intended behaviour and I misunderstood this functionality?

Thanks, Gábor

SZEDER Gábor· Oct 2, 2008, 14:25 UTC · re: SZEDER Gábor · lore

Re: update-index --unresolve

On Thu, Oct 02, 2008 at 04:18:53PM +0200, SZEDER Gábor wrote:
Show 30 quoted lines
> > > How could I clear those states by accident (or intentionally)?
> > 
> > "git add <file>", or "git update-index <file>", or error in handling
> > merge tool via git-mergetool.
> Thanks for your fast reply.
> 
> However:
> 
> # ...  do a conflicting merge
> (master|MERGING)$ echo 4 >one
> (master|MERGING)$ git status
> one: needs merge
> # On branch master
> # Changed but not updated:
> #   (use "git add <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working
> #   directory)
> #
> #       unmerged:   one
> #
> no changes added to commit (use "git add" and/or "git commit -a")
> (master|MERGING)$ git add one
> (master|MERGING)$ git status
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #       modified:   one
> #
> (master|MERGING)$ git update-index --unresolve

Ah, that should be 'git update-index --unresolve one', and everything works as expected.

Sorry, Gábor

← back to recent threads