{"thread":{"id":"58815","subject":"bug report: add/delete instead of rename","startedAt":"2022-11-18T19:47:39Z","lastAt":"2022-11-18T20:00:25Z","messageCount":3,"participants":["Sergey Ivanov","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"467533","messageId":"CAJCbrz5+LC9g34x0E_2HAezFNaMGW7ECSA9iXpHgnAHGoQNzHA@mail.gmail.com","threadId":"58815","inReplyTo":null,"subject":"bug report: add/delete instead of rename","fromName":"Sergey Ivanov","fromEmail":"icegood1980@gmail.com","sentAt":"2022-11-18T19:47:16Z","receivedAt":"2022-11-18T19:47:39Z","isPatch":false,"sender":{"key":"icegood1980@gmail.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened?\n\nhard rename of files and directories via 'git mv' . git status before\ncommit for some related files:\n\nChanges to be committed:\n  (use \"git restore --staged <file>...\" to unstage)\n\nnew file:   sepolicy/private/file.te\nrenamed:    sepolicy/components/icl_infotainment.te ->\nsepolicy/private/icl_infotainment.te\nrenamed:    sepolicy/common/hal_icl_infotainment.te ->\nsepolicy/public/icl_infotainment.te\nrenamed:    sepolicy/common/file.te -> sepolicy/public/file.te\n\nChanges not staged for commit:\n  (use \"git add/rm <file>...\" to update what will be committed)\n  (use \"git restore <file>...\" to discard changes in working directory)\nmodified:   sepolicy/private/icl_infotainment.te\nmodified:   sepolicy/public/file.te\n\nWhat did you expect to happen?\n\nAll related nodes are renamed during commit\n\nWhat happened instead? (Actual behavior)\n\ndelete mode 100644 sepolicy/common/file.te\ndelete mode 100644 sepolicy/components/icl_infotainment.te\ncreate mode 100644 sepolicy/private/icl_infotainment.te\ncreate mode 100644 sepolicy/private/file.te\ncreate mode 100644 sepolicy/public/file.te\nrename sepolicy/{common/hal_icl_infotainment.te =>\npublic/icl_infotainment.te} (90%)\n\nWhat's different between what you expected and what actually happened?\n\nInstead of renaming 2 more pairs of create/delete formed.\nIt makes harder to see changes on gitlab UI after push.\n\nAnything else you want to add:\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.37.2\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 5.19.0-23-generic #24-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct\n14 15:39:57 UTC 2022 x86_64\ncompiler info: gnuc: 12.1\nlibc info: glibc: 2.36\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n\n\n-- \nKind regards,\nSergey Ivanov\n"},{"id":"467535","messageId":"221118.86iljcf3a9.gmgdl@evledraar.gmail.com","threadId":"58815","inReplyTo":"CAJCbrz5+LC9g34x0E_2HAezFNaMGW7ECSA9iXpHgnAHGoQNzHA@mail.gmail.com","subject":"Re: bug report: add/delete instead of rename","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-18T19:50:43Z","receivedAt":"2022-11-18T19:53:08Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Nov 18 2022, Sergey Ivanov wrote:\n\n> Thank you for filling out a Git bug report!\n> Please answer the following questions to help us understand your issue.\n>\n> What did you do before the bug happened?\n>\n> hard rename of files and directories via 'git mv' . git status before\n> commit for some related files:\n>\n> Changes to be committed:\n>   (use \"git restore --staged <file>...\" to unstage)\n>\n> new file:   sepolicy/private/file.te\n> renamed:    sepolicy/components/icl_infotainment.te ->\n> sepolicy/private/icl_infotainment.te\n> renamed:    sepolicy/common/hal_icl_infotainment.te ->\n> sepolicy/public/icl_infotainment.te\n> renamed:    sepolicy/common/file.te -> sepolicy/public/file.te\n>\n> Changes not staged for commit:\n>   (use \"git add/rm <file>...\" to update what will be committed)\n>   (use \"git restore <file>...\" to discard changes in working directory)\n> modified:   sepolicy/private/icl_infotainment.te\n> modified:   sepolicy/public/file.te\n>\n> What did you expect to happen?\n>\n> All related nodes are renamed during commit\n>\n> What happened instead? (Actual behavior)\n>\n> delete mode 100644 sepolicy/common/file.te\n> delete mode 100644 sepolicy/components/icl_infotainment.te\n> create mode 100644 sepolicy/private/icl_infotainment.te\n> create mode 100644 sepolicy/private/file.te\n> create mode 100644 sepolicy/public/file.te\n> rename sepolicy/{common/hal_icl_infotainment.te =>\n> public/icl_infotainment.te} (90%)\n>\n> What's different between what you expected and what actually happened?\n>\n> Instead of renaming 2 more pairs of create/delete formed.\n> It makes harder to see changes on gitlab UI after push.\n>\n> Anything else you want to add:\n>\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n\nGit, unlike some other SCM's (e.g. SVN) doesn't track renames at\nall. I.e. it doesn't matter if you use \"git mv\", or just manually remove\na file, \"git add\" that removal, add another file separately etc.\n\nSo I think you're probably just running into that. I.e. \"renames\" are\nheuristically determined based on how similar the file is\nbefore/after. Likely you rewrote it more than the rename detection was\nwilling to accept.\n\nBut see the \"git log\" manual for details, as it's a heuristic you can\ntweak it, and e.g. set -M<n> for how similar two files should be before\nthey're considered a rename.\n"},{"id":"467536","messageId":"CAJCbrz56=ozc6BCmh=M7Cxmk5Uqb12XrRALGzMVfhff2+QKCqg@mail.gmail.com","threadId":"58815","inReplyTo":"221118.86iljcf3a9.gmgdl@evledraar.gmail.com","subject":"Re: bug report: add/delete instead of rename","fromName":"Sergey Ivanov","fromEmail":"icegood1980@gmail.com","sentAt":"2022-11-18T20:00:07Z","receivedAt":"2022-11-18T20:00:25Z","isPatch":false,"sender":{"key":"icegood1980@gmail.com","avatar":null},"body":"Awesome, thanks!\n\nпт, 18 нояб. 2022 г. в 21:53, Ævar Arnfjörð Bjarmason <avarab@gmail.com>:\n>\n>\n> On Fri, Nov 18 2022, Sergey Ivanov wrote:\n>\n> > Thank you for filling out a Git bug report!\n> > Please answer the following questions to help us understand your issue.\n> >\n> > What did you do before the bug happened?\n> >\n> > hard rename of files and directories via 'git mv' . git status before\n> > commit for some related files:\n> >\n> > Changes to be committed:\n> >   (use \"git restore --staged <file>...\" to unstage)\n> >\n> > new file:   sepolicy/private/file.te\n> > renamed:    sepolicy/components/icl_infotainment.te ->\n> > sepolicy/private/icl_infotainment.te\n> > renamed:    sepolicy/common/hal_icl_infotainment.te ->\n> > sepolicy/public/icl_infotainment.te\n> > renamed:    sepolicy/common/file.te -> sepolicy/public/file.te\n> >\n> > Changes not staged for commit:\n> >   (use \"git add/rm <file>...\" to update what will be committed)\n> >   (use \"git restore <file>...\" to discard changes in working directory)\n> > modified:   sepolicy/private/icl_infotainment.te\n> > modified:   sepolicy/public/file.te\n> >\n> > What did you expect to happen?\n> >\n> > All related nodes are renamed during commit\n> >\n> > What happened instead? (Actual behavior)\n> >\n> > delete mode 100644 sepolicy/common/file.te\n> > delete mode 100644 sepolicy/components/icl_infotainment.te\n> > create mode 100644 sepolicy/private/icl_infotainment.te\n> > create mode 100644 sepolicy/private/file.te\n> > create mode 100644 sepolicy/public/file.te\n> > rename sepolicy/{common/hal_icl_infotainment.te =>\n> > public/icl_infotainment.te} (90%)\n> >\n> > What's different between what you expected and what actually happened?\n> >\n> > Instead of renaming 2 more pairs of create/delete formed.\n> > It makes harder to see changes on gitlab UI after push.\n> >\n> > Anything else you want to add:\n> >\n> > Please review the rest of the bug report below.\n> > You can delete any lines you don't wish to share.\n>\n> Git, unlike some other SCM's (e.g. SVN) doesn't track renames at\n> all. I.e. it doesn't matter if you use \"git mv\", or just manually remove\n> a file, \"git add\" that removal, add another file separately etc.\n>\n> So I think you're probably just running into that. I.e. \"renames\" are\n> heuristically determined based on how similar the file is\n> before/after. Likely you rewrote it more than the rename detection was\n> willing to accept.\n>\n> But see the \"git log\" manual for details, as it's a heuristic you can\n> tweak it, and e.g. set -M<n> for how similar two files should be before\n> they're considered a rename.\n\n\n\n-- \nKind regards,\nSergey Ivanov\n"}]}