Re: [PATCH] t4202 (log): add failing test for log with subtree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thomas Rast wrote:
> [...]

I think you've misunderstood the whole thing.  The histories of M^1
and M^2 are completely unrelated: they're from different projects
altogether.  Considering the /ichi in M^2 a "rename" of the /ichi in
M^1 is completely wrong.  They have nothing to do with each other.  I
intentionally named it "ichi" in my orphan branch just to drive my
point.  I suspect you've got confused because I used an orphan branch
to emulate a different project's history.  If you want an end-user
understanding of the problem, use git subtree:

    $ cd /tmp
    $ git clone gh:artagnon/varlog
    $ cd varlog
    $ git subtree add --prefix=clayoven \
       gh:artagnon/clayoven master
    $ cd clayoven
    $ git log README.md

What do you expect?  The same output you would get if you cloned
gh:artagnon/clayoven separately and executed 'git log README.md' on
it.

Now, clayoven's README.md (the one in HEAD^2) has nothing to do with
varlog's README.md (the one in HEAD^1).  It's just incidental that
both projects have a README.md.  I repeat: clayoven and varlog have
_nothing_ to do with each other.  If I say git log --follow README.md
in the above example, I don't even get the HEAD commit.  And I
wouldn't expect to either.

I will repeat this: --follow has nothing to do with the problem I've
specified.  And it is not tied to "renaming" (ie. changing the
name/path of a file) as you've made it look.  If you're still not
convinced, I've included a testcase for --follow "following" over a
merge commit (include it after the --follow test in the t4202).  Try
it without the --follow and you'll see what I mean.  Neither the
filename nor the filepath of ichi has changed in this example.

-- 8< --
test_expect_success '--follow over merge' '
	git checkout -b featurebranch
	echo foodle >>ichi &&
	git add ichi &&
	test_tick &&
	git commit -m "add a line to the end of ichi" &&
	echo moodle >unrelated &&
	git add unrelated &&
	test_tick &&
	git commit -m quux &&
	git checkout master &&
	mv ichi ichi.bak &&
	echo gooble >ichi &&
	cat ichi.bak >>ichi &&
	git add ichi &&
	test_tick &&
	git commit -m "add a line to the beginning of ichi" &&
	git merge featurebranch &&
	git log --follow --oneline ichi >actual &&
	cat >expect <<-\EOF &&
	df26551 add a line to the beginning of ichi
	882d8d9 add a line to the end of ichi
	2fbe8c0 third
	f7dab8e second
	3a2fdcb initial
	EOF
	test_cmp expect actual
'
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]