{"thread":{"id":"49431","subject":"Triggering \"BUG: wt-status.c:476: multiple renames on the same target? how?\"","startedAt":"2018-09-26T20:27:35Z","lastAt":"2018-09-27T04:20:35Z","messageCount":4,"participants":["Andrea Stacchiotti","Ævar Arnfjörð Bjarmason","Elijah Newren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"359000","messageId":"3c11c193-a978-69be-4b8e-4b59b270338e@gmail.com","threadId":"49431","inReplyTo":null,"subject":"Triggering \"BUG: wt-status.c:476: multiple renames on the same target? how?\"","fromName":"Andrea Stacchiotti","fromEmail":"andreastacchiotti@gmail.com","sentAt":"2018-09-26T20:27:27Z","receivedAt":"2018-09-26T20:27:35Z","isPatch":false,"sender":{"key":"andreastacchiotti@gmail.com","avatar":null},"body":"Dear maintainer(s),\n\nthe following script, when executed with git 2.19 triggers the bug in\nthe subject line.\nThe problem seems to be the interaction between add -N and rename detection.\n\nThe git binary used is the one currently packaged in Debian unstable.\n\nI have searched the list for the bug text and have found nothing,\napologies if the bug is already known.\n\nSystem information, script content and script output follow.\n\nAndrea Stacchiotti\n\n--------------------------\n\nandreas@trelitri:/tmp$ uname -a\nLinux trelitri 4.17.0-3-amd64 #1 SMP Debian 4.17.17-1 (2018-08-18)\nx86_64 GNU/Linux\nandreas@trelitri:/tmp$ git --version\ngit version 2.19.0\n\nandreas@trelitri:/tmp$ cat bugscript.sh\n# Make a test repo\ngit init testrepo\ncd testrepo\ngit config user.name A\ngit config user.email B\n\n# Add a file called orig\necho 'a' > orig\ngit add orig\ngit commit -m'orig'\n\n# Copy orig in new and modify orig\ncp orig new\necho 'b' > orig\n\n# add -N and then commit trigger the bug\ngit add -N new\ngit commit\n\n# Cleanup\ncd ..\nrm -rf testrepo\n\nandreas@trelitri:/tmp$ LANG=C ./bugscript.sh\nInitialized empty Git repository in /tmp/testrepo/.git/\n[master (root-commit) 5dedf30] orig\n 1 file changed, 0 insertions(+), 0 deletions(-)\n create mode 100644 orig\nBUG: wt-status.c:476: multiple renames on the same target? how?\n./bugscript.sh: line 18: 22762 Aborted                 git commit\n"},{"id":"359004","messageId":"877ej8j7uf.fsf@evledraar.gmail.com","threadId":"49431","inReplyTo":"3c11c193-a978-69be-4b8e-4b59b270338e@gmail.com","subject":"Re: Triggering \"BUG: wt-status.c:476: multiple renames on the same target? how?\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-09-26T20:56:40Z","receivedAt":"2018-09-26T20:56:44Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Sep 26 2018, Andrea Stacchiotti wrote:\n\n> Dear maintainer(s),\n>\n> the following script, when executed with git 2.19 triggers the bug in\n> the subject line.\n> The problem seems to be the interaction between add -N and rename detection.\n>\n> The git binary used is the one currently packaged in Debian unstable.\n>\n> I have searched the list for the bug text and have found nothing,\n> apologies if the bug is already known.\n>\n> System information, script content and script output follow.\n>\n> Andrea Stacchiotti\n>\n> --------------------------\n>\n> andreas@trelitri:/tmp$ uname -a\n> Linux trelitri 4.17.0-3-amd64 #1 SMP Debian 4.17.17-1 (2018-08-18)\n> x86_64 GNU/Linux\n> andreas@trelitri:/tmp$ git --version\n> git version 2.19.0\n>\n> andreas@trelitri:/tmp$ cat bugscript.sh\n> # Make a test repo\n> git init testrepo\n> cd testrepo\n> git config user.name A\n> git config user.email B\n>\n> # Add a file called orig\n> echo 'a' > orig\n> git add orig\n> git commit -m'orig'\n>\n> # Copy orig in new and modify orig\n> cp orig new\n> echo 'b' > orig\n>\n> # add -N and then commit trigger the bug\n> git add -N new\n> git commit\n>\n> # Cleanup\n> cd ..\n> rm -rf testrepo\n>\n> andreas@trelitri:/tmp$ LANG=C ./bugscript.sh\n> Initialized empty Git repository in /tmp/testrepo/.git/\n> [master (root-commit) 5dedf30] orig\n>  1 file changed, 0 insertions(+), 0 deletions(-)\n>  create mode 100644 orig\n> BUG: wt-status.c:476: multiple renames on the same target? how?\n> ./bugscript.sh: line 18: 22762 Aborted                 git commit\n\nI can't reproduce this on Debian AMD64 either 2.19.0 in unstable, or\n2.19.0.605.g01d371f741 in experimental. I tried moving my ~/.gitconfig\nout of the way, do you have some config options there that might be\ncontributing to this?\n"},{"id":"359005","messageId":"d2a8619b-5110-0a03-5559-fd84cb7509b6@gmail.com","threadId":"49431","inReplyTo":"877ej8j7uf.fsf@evledraar.gmail.com","subject":"Re: Triggering \"BUG: wt-status.c:476: multiple renames on the same target? how?\"","fromName":"Andrea Stacchiotti","fromEmail":"andreastacchiotti@gmail.com","sentAt":"2018-09-26T21:02:07Z","receivedAt":"2018-09-26T21:02:13Z","isPatch":false,"sender":{"key":"andreastacchiotti@gmail.com","avatar":null},"body":"I'm very sorry, I indeed forgot the `diff.renames=copies`.\n\nThe following script can reproduce the bug even with a blank config:\n\n---------------------\n\n# Make a test repo\ngit init testrepo\ncd testrepo\ngit config user.name A\ngit config user.email B\ngit config diff.renames copies\n\n# Add a file called orig\necho 'a' > orig\ngit add orig\ngit commit -m'orig'\n\n# Copy orig in new and modify orig\ncp orig new\necho 'b' > orig\n\n# add -N and then commit trigger the bug\ngit add -N new\ngit commit\n\n# Cleanup\ncd ..\nrm -rf testrepo\n\nIl 26/09/18 22:56, Ævar Arnfjörð Bjarmason ha scritto:\n> \n> On Wed, Sep 26 2018, Andrea Stacchiotti wrote:\n> \n>> Dear maintainer(s),\n>>\n>> the following script, when executed with git 2.19 triggers the bug in\n>> the subject line.\n>> The problem seems to be the interaction between add -N and rename detection.\n>>\n>> The git binary used is the one currently packaged in Debian unstable.\n>>\n>> I have searched the list for the bug text and have found nothing,\n>> apologies if the bug is already known.\n>>\n>> System information, script content and script output follow.\n>>\n>> Andrea Stacchiotti\n>>\n>> --------------------------\n>>\n>> andreas@trelitri:/tmp$ uname -a\n>> Linux trelitri 4.17.0-3-amd64 #1 SMP Debian 4.17.17-1 (2018-08-18)\n>> x86_64 GNU/Linux\n>> andreas@trelitri:/tmp$ git --version\n>> git version 2.19.0\n>>\n>> andreas@trelitri:/tmp$ cat bugscript.sh\n>> # Make a test repo\n>> git init testrepo\n>> cd testrepo\n>> git config user.name A\n>> git config user.email B\n>>\n>> # Add a file called orig\n>> echo 'a' > orig\n>> git add orig\n>> git commit -m'orig'\n>>\n>> # Copy orig in new and modify orig\n>> cp orig new\n>> echo 'b' > orig\n>>\n>> # add -N and then commit trigger the bug\n>> git add -N new\n>> git commit\n>>\n>> # Cleanup\n>> cd ..\n>> rm -rf testrepo\n>>\n>> andreas@trelitri:/tmp$ LANG=C ./bugscript.sh\n>> Initialized empty Git repository in /tmp/testrepo/.git/\n>> [master (root-commit) 5dedf30] orig\n>>  1 file changed, 0 insertions(+), 0 deletions(-)\n>>  create mode 100644 orig\n>> BUG: wt-status.c:476: multiple renames on the same target? how?\n>> ./bugscript.sh: line 18: 22762 Aborted                 git commit\n> \n> I can't reproduce this on Debian AMD64 either 2.19.0 in unstable, or\n> 2.19.0.605.g01d371f741 in experimental. I tried moving my ~/.gitconfig\n> out of the way, do you have some config options there that might be\n> contributing to this?\n> \n"},{"id":"359027","messageId":"CABPp-BEMTn2LEq8pB7Yenudnp0rSRfXCzeej4p3SE0BGovosmA@mail.gmail.com","threadId":"49431","inReplyTo":"875zysj6fq.fsf@evledraar.gmail.com","subject":"Re: Triggering \"BUG: wt-status.c:476: multiple renames on the same target? how?\"","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-09-27T04:20:22Z","receivedAt":"2018-09-27T04:20:35Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Wed, Sep 26, 2018, 2:27 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n>\n> On Wed, Sep 26 2018, Andrea Stacchiotti wrote:\n>\n> > I'm very sorry, I indeed forgot the `diff.renames=copies`.\n> >\n> > The following script can reproduce the bug even with a blank config:\n\nThanks for the bug report and the simple testcase.\n\n> > ---------------------\n> >\n> > # Make a test repo\n> > git init testrepo\n> > cd testrepo\n> > git config user.name A\n> > git config user.email B\n> > git config diff.renames copies\n> >\n> > # Add a file called orig\n> > echo 'a' > orig\n> > git add orig\n> > git commit -m'orig'\n> >\n> > # Copy orig in new and modify orig\n> > cp orig new\n> > echo 'b' > orig\n> >\n> > # add -N and then commit trigger the bug\n> > git add -N new\n> > git commit\n> >\n> > # Cleanup\n> > cd ..\n> > rm -rf testrepo\n>\n> Thanks. Bisecting shows that the bug is in dc6b1d92ca (\"wt-status: use\n> settings from git_diff_ui_config\", 2018-05-04) first released with\n> 2.18.0.\n\nThe bisect is slightly misleading; the bug was introduced in 2.17.0\nfor renames, and when copy detection became a thing in 2.18.0 it also\nincidentally would trigger with copies.  I'll post a patch soon.\n"}]}