From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: git <git@vger.kernel.org>
Subject: Re: [BUG] Silent data loss on merge with uncommited changes + renames
Date: Mon, 22 Apr 2013 16:43:34 +0200 [thread overview]
Message-ID: <vpqtxmy7hih.fsf@grenoble-inp.fr> (raw)
In-Reply-To: <517547F8.3040004@viscovery.net> (Johannes Sixt's message of "Mon, 22 Apr 2013 16:23:52 +0200")
Johannes Sixt <j.sixt@viscovery.net> writes:
> Am 4/22/2013 11:24, schrieb Matthieu Moy:
>> Following the discussion on "merge with uncommited changes" inside the
>> "git pull --autostash" thread, I did a bit of testing, and encountered a
>> case with silent data loss. In short: merge a branch introducing changes
>> to a file. If the file has been renamed in the current branch, then "git
>> merge" follows the rename and brings changes to the renamed file, but
>> uncommited changes in this file are overriden silently.
>
> Can you check whether your case is already covered by one of:
>
> git grep expect_failure t/*merge*
Indeed, it's already here:
test_expect_failure 'will not overwrite unstaged changes in renamed file' '
git reset --hard c1 &&
git mv c1.c other.c &&
git commit -m rename &&
cp important other.c &&
git merge c1a &&
test_cmp important other.c
'
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
next prev parent reply other threads:[~2013-04-22 14:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 9:24 [BUG] Silent data loss on merge with uncommited changes + renames Matthieu Moy
2013-04-22 14:23 ` Johannes Sixt
2013-04-22 14:43 ` Matthieu Moy [this message]
2013-04-22 15:19 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vpqtxmy7hih.fsf@grenoble-inp.fr \
--to=matthieu.moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).