From: Mark Lodato <lodatom@gmail.com>
To: git list <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Bug report: git status does not report unmerged entries with copies
Date: Wed, 6 Apr 2011 20:34:26 -0400 [thread overview]
Message-ID: <BANLkTikWVgsX6yEY=d7kEcO5PLMTRwDU_A@mail.gmail.com> (raw)
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
next reply other threads:[~2011-04-07 0:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 0:34 Mark Lodato [this message]
2011-04-07 13:53 ` Bug report: git status does not report unmerged entries with copies Martin von Zweigbergk
2011-04-07 23:36 ` Mark Lodato
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='BANLkTikWVgsX6yEY=d7kEcO5PLMTRwDU_A@mail.gmail.com' \
--to=lodatom@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).