All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug report: git status does not report unmerged entries with copies
@ 2011-04-07  0:34 Mark Lodato
  2011-04-07 13:53 ` Martin von Zweigbergk
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Lodato @ 2011-04-07  0:34 UTC (permalink / raw)
  To: git list, Junio C Hamano

Commit 4d4d572, "status: show worktree status of conflicted paths
separately" introduced the following bug:  If one tries to merge two
branches with a conflict, where the conflicting file was also copied
in one of the branches, "git status" (but not "git status -sb" or
git-gui) fails to report the unmerged status.  You can use the below
test file to see the error.  A similar test should probably be
integrated into one of the existing git-status test files, though you
may need to get rid of the "sed -i" command.

$ git status
# On branch master
# Changes to be committed:
#
#       renamed:    file -> copy
#
$ git status -sb
## master
R  file -> copy
 U file

In the above, "git status" should have reported "file" being in an
unmerged state.  It probably should also mark "copy" as a copy, not a
rename.

-------- 8< --------
#!/bin/sh
#
# Copyright (c) 2011 Mark Lodato
#

test_description='git status on merge with copy'

. ./test-lib.sh

test_expect_success 'setup' '
        echo first > file &&
        echo second >> file &&
        echo third >> file &&
        echo fourth >> file &&
        git add file &&
        git commit -m initial &&
        git checkout -b branch &&
        cp file copy &&
        git add copy &&
        git commit -m copy &&
        sed -i -e "s/second/fifth/" file &&
        git add file &&
        git commit -m fifth &&
        git checkout master &&
        sed -i -e "s/second/sixth/" file &&
        git add file &&
        git commit -m sixth
'

test_expect_success 'merge' '
        ! git merge branch
'

test_expect_success 'status' '
        git status | grep unmerged
'

test_done

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug report: git status does not report unmerged entries with copies
  2011-04-07  0:34 Bug report: git status does not report unmerged entries with copies Mark Lodato
@ 2011-04-07 13:53 ` Martin von Zweigbergk
  2011-04-07 23:36   ` Mark Lodato
  0 siblings, 1 reply; 3+ messages in thread
From: Martin von Zweigbergk @ 2011-04-07 13:53 UTC (permalink / raw)
  To: Mark Lodato; +Cc: git list, Junio C Hamano


On Wed, 6 Apr 2011, Mark Lodato wrote:

> Commit 4d4d572, "status: show worktree status of conflicted paths
> separately" introduced the following bug:  If one tries to merge two
> branches with a conflict, where the conflicting file was also copied
> in one of the branches, "git status" (but not "git status -sb" or
> git-gui) fails to report the unmerged status.  You can use the below
> test file to see the error.  A similar test should probably be
> integrated into one of the existing git-status test files, though you
> may need to get rid of the "sed -i" command.
> 
> $ git status
> # On branch master
> # Changes to be committed:
> #
> #       renamed:    file -> copy
> #
> $ git status -sb
> ## master
> R  file -> copy
>  U file
> 
> In the above, "git status" should have reported "file" being in an
> unmerged state.  It probably should also mark "copy" as a copy, not a
> rename.

I sent a patch for this not so long ago [1]. It is currently in "next"
as commit d7c9bf2. I think Junio said the plan is to release it in
1.7.5.


/Martin

 [1] http://thread.gmane.org/gmane.comp.version-control.git/169289/focus=169887

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug report: git status does not report unmerged entries with copies
  2011-04-07 13:53 ` Martin von Zweigbergk
@ 2011-04-07 23:36   ` Mark Lodato
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Lodato @ 2011-04-07 23:36 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git list, Junio C Hamano

On Thu, Apr 7, 2011 at 9:53 AM, Martin von Zweigbergk
<martin.von.zweigbergk@gmail.com> wrote:
>
> On Wed, 6 Apr 2011, Mark Lodato wrote:
>
>> Commit 4d4d572, "status: show worktree status of conflicted paths
>> separately" introduced the following bug:  If one tries to merge two
>> branches with a conflict, where the conflicting file was also copied
>> in one of the branches, "git status" (but not "git status -sb" or
>> git-gui) fails to report the unmerged status.
>
> I sent a patch for this not so long ago [1]. It is currently in "next"
> as commit d7c9bf2. I think Junio said the plan is to release it in
> 1.7.5.
>
>  [1] http://thread.gmane.org/gmane.comp.version-control.git/169289/focus=169887

Ah yes, sorry.  Your commit does fix the problem.  My test script
reports a failure, but it is only because my grep command was
insufficient to properly test.  (At the very least, I should have
check case insensitively.)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-07 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-07  0:34 Bug report: git status does not report unmerged entries with copies Mark Lodato
2011-04-07 13:53 ` Martin von Zweigbergk
2011-04-07 23:36   ` Mark Lodato

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.