From: Lars Schneider <larsxschneider@gmail.com>
To: Elijah Newren <newren@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>, Jeff King <peff@peff.net>
Subject: Re: [BUG] Symbolic links break "git fast-export"?
Date: Sun, 30 Jun 2019 07:01:06 -0700 [thread overview]
Message-ID: <3AA3CC52-84FE-4FD0-8977-D4FBCF0DCE2C@gmail.com> (raw)
In-Reply-To: <CABPp-BE8um5g98jqWawsuG2dAvO6AZcR54vrRzAkJbq+L3K6Zw@mail.gmail.com>
> On Jun 24, 2019, at 5:33 AM, Elijah Newren <newren@gmail.com> wrote:
>
> On Mon, Jun 24, 2019 at 5:05 AM Lars Schneider <larsxschneider@gmail.com> wrote:
>>
>> Hi folks,
>>
>> Is my understanding correct, that `git fast-export | git fast-import`
>> should not modify the repository? If yes, then we might have a bug in
>> `git fast-export` if symbolic directory links are removed and converted
>> to a real directory.
>>
>> ...
>
> My first reaction was, "we regressed on this again?", but it looks
> like my original fix for directory/file changes only handled one
> direction. Thus, my commit 060df6242281 ("fast-export: Fix output
> order of D/F changes", 2010-07-09) probably *caused* this bug. We
> should probably just sort not based on filename, but on changetype --
> send all the deletes to fast-import before we send the modifies.
060df6242281 is interesting! If I revert the changes in builtin/fast-export.c,
then the "t9350:directory becomes symlink" test still passes nowadays.
Plus, my my new test case passes too:
test_expect_success 'when transforming a symlink to a directory' '
test_create_repo src &&
mkdir src/foo &&
echo a_line >src/foo/file.txt &&
git -C src add foo/file.txt &&
git -C src commit -m 1st_commit &&
ln -s src/foo src/bar &&
git -C src add bar &&
git -C src commit -m 2nd_commit &&
rm src/bar &&
mkdir src/bar &&
echo b_line >src/bar/b_file.txt &&
git -C src add . &&
git -C src commit -m 3rd_commit &&
test_create_repo dst &&
git -C src fast-export --all &&
git -C src fast-export --all | git -C dst fast-import &&
git -C src show >expected &&
git -C dst show >actual &&
test_cmp expected actual
'
Do you think it would make sense to revert the qsort change
in fast-export? I haven't bisected yet which other change made
the qsort change obsolete.
Thanks,
Lars
next prev parent reply other threads:[~2019-06-30 14:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 11:03 [BUG] Symbolic links break "git fast-export"? Lars Schneider
2019-06-24 12:33 ` Elijah Newren
2019-06-24 18:58 ` Jeff King
2019-06-30 13:05 ` Lars Schneider
2019-06-30 18:28 ` Johannes Sixt
2019-07-01 17:45 ` Elijah Newren
2019-06-30 14:01 ` Lars Schneider [this message]
2019-07-01 18:02 ` Elijah Newren
2019-06-24 12:55 ` Elijah Newren
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=3AA3CC52-84FE-4FD0-8977-D4FBCF0DCE2C@gmail.com \
--to=larsxschneider@gmail.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
--cc=peff@peff.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.
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).