Git development
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Ralf Thielow <ralf.thielow@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug? Files are losing history after subtree merge
Date: Wed, 02 Oct 2013 21:42:42 +0200	[thread overview]
Message-ID: <vpqsiwjlarx.fsf@anie.imag.fr> (raw)
In-Reply-To: <1380741617-14593-1-git-send-email-ralf.thielow@gmail.com> (Ralf Thielow's message of "Wed, 2 Oct 2013 21:20:17 +0200")

Ralf Thielow <ralf.thielow@gmail.com> writes:

> Hi,
>
> recently I did a merge where a complete repo shall be
> merged into a specific directory of another repo. I
> tried both the "subtree" merge strategy and the option
> "-Xsubtree=<dir>" of "recursive". I noticed that in both
> cases somehow the history of single files were lost
> during these merges (with history I mean 'git log <file>'
> and 'git log --follow <file>').

This is a known bug of "git log --follow": it does not follow accross
subtree merge. But your history is still there (try gitk on your project
for example).

Technically, a subtree merge is a merge commit in which files are
renamed compared to the second parent. --follow does not manage this
case.

> diff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh
> index 73fc240..e9a97d7 100755
> --- a/t/t6029-merge-subtree.sh
> +++ b/t/t6029-merge-subtree.sh
> @@ -61,6 +61,14 @@ test_expect_success 'initial merge' '
>  	test_cmp expected actual
>  '
>  
> +test_expect_failure 'file keeps history after subtree merge' '
> +	cd ../git-gui &&
> +	git log --follow git-gui.sh >../git/expected &&
> +	cd ../git &&
> +	git log --follow git-gui/git-gui.sh >actual &&
> +	test_cmp expected actual
> +'
> +

That would actually be good to add a failing test to "document" the
failure.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2013-10-02 19:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02 19:20 Bug? Files are losing history after subtree merge Ralf Thielow
2013-10-02 19:42 ` Matthieu Moy [this message]
2013-10-02 20:10   ` Ralf Thielow
     [not found]   ` <CAN0XMO+y3Cwsz5LwbmzHBe31Rf-RwMykynLmvmqUsxY8f+1dsQ@mail.gmail.com>
2013-10-02 20:21     ` Matthieu Moy
2013-10-02 20:44       ` Ralf Thielow

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=vpqsiwjlarx.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=ralf.thielow@gmail.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