{"thread":{"id":"53299","subject":"Commit change disappeared from repository","startedAt":"2020-04-23T19:22:12Z","lastAt":"2020-04-24T14:34:55Z","messageCount":3,"participants":["Renato Botelho","Derrick Stolee"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"396023","messageId":"7b4f2b10-e80d-d4af-6154-6665e37da623@FreeBSD.org","threadId":"53299","inReplyTo":null,"subject":"Commit change disappeared from repository","fromName":"Renato Botelho","fromEmail":"garga@freebsd.org","sentAt":"2020-04-23T19:22:04Z","receivedAt":"2020-04-23T19:22:12Z","isPatch":false,"sender":{"key":"garga@freebsd.org","avatar":"https://gravatar.com/avatar/695c68fb2f0629998c430204a7212aec683a3f87ec5eeaae236fd2376e790bfc?d=mp&s=160"},"body":"Hello,\n\nI'm sending it here to devel list because after asking around at IRC and\nalso to friends we ended up with no reasonable explanation about what\nhappened, and it lead me to consider maybe it could be a bug (!?!?)\n\nI'm running git 2.26.2 on macOS Catalina.\n\nWe first noted a package built from pfSense FreeBSD-ports repository [1]\nwas missing a patch and then after investigate we found these relevant\ninformation (it's all about RELENG_2_4_5 branch):\n\n1. The original commit made in Jan 3 is present in the repo:\n\n❯ git log RELENG_2_4_5 | grep -A5 53e5b36834f1\ncommit 53e5b36834f1\nAuthor: jim-p <jimp@netgate.com>\nDate:   Fri Jan 3 11:50:09 2020 -0500\n\n    Allow sshguard to process via stdin again. Issue #9971\n\n2. Despite the fact commit was present, the change it introduced was not\npresent on repository contents.\n\n3. This commit changed the file\nsecurity/sshguard/files/patch-src_sshguard.in as we can see:\n\n❯ git show 53e5b36834f1 -- security/sshguard/files/patch-src_sshguard.in\ncommit 53e5b36834f1\nAuthor: jim-p <jimp@netgate.com>\nDate:   Fri Jan 3 11:50:09 2020 -0500\n\n    Allow sshguard to process via stdin again. Issue #9971\n\ndiff --git a/security/sshguard/files/patch-src_sshguard.in\nb/security/sshguard/files/patch-src_sshguard.in\nindex 6881e162028f..788f0ac2bc47 100644\n--- a/security/sshguard/files/patch-src_sshguard.in\n+++ b/security/sshguard/files/patch-src_sshguard.in\n@@ -1,6 +1,6 @@\n --- src/sshguard.in.orig       2019-05-23 22:25:17 UTC\n +++ src/sshguard.in\n-@@ -97,14 +97,8 @@ elif [ -z \"$tailcmd\" ]; then\n+@@ -97,19 +97,12 @@ elif [ -z \"$tailcmd\" ]; then\n      exit 1\n  fi\n\n@@ -17,3 +17,9 @@\n\n  # Make sure to kill entire process group (subshell) on exit/interrupts.\n  trap \"clean_and_exit\" INT TERM\n+ trap \"kill 0\" EXIT\n+\n+ eval $tailcmd | $libexec/sshg-parser | \\\n+-    $libexec/sshg-blocker $flags | $BACKEND &\n+-wait\n++    $libexec/sshg-blocker $flags | ($BACKEND ; pkill -PIPE -P $$)\n\n4. Here the odd facts start, git log doesn't show this commit when\nfiltering the file it changed, which btw, was never moved/renamed.\n\n❯ git log RELENG_2_4_5 -- security/sshguard/files/patch-src_sshguard.in\ncommit 88d6f4488ab5\nAuthor: delphij <delphij@FreeBSD.org>\nDate:   Sun Nov 10 18:34:54 2019 +0000\n\n    Remove redundant pidfile check.\n\n    This fixes an issue that SSHguard won't start after an incompelete\n    shutdown.\n\n    PR:             ports/241751\n    Approved by:    portmgr (bugfix blanket)\n    MFH:            2019Q4\n\n5. After trying to understand what happened, --follow parameter was used\nand it shows that commit.  As I mentioned previously, the change it did\non that file was not there, and no other commit reverting it show up.\n\n❯ git log RELENG_2_4_5 --follow -M --\nsecurity/sshguard/files/patch-src_sshguard.in\ncommit 53e5b36834f1\nAuthor: jim-p <jimp@netgate.com>\nDate:   Fri Jan 3 11:50:09 2020 -0500\n\n    Allow sshguard to process via stdin again. Issue #9971\n\ncommit e4cccfc2c3ab\nAuthor: delphij <delphij@FreeBSD.org>\nDate:   Sun Nov 10 18:35:55 2019 +0000\n\n    MFH: r517220\n\n    Remove redundant pidfile check.\n\n    This fixes an issue that SSHguard won't start after an incompelete\n    shutdown.\n\n    PR:             ports/241751\n    Approved by:    portmgr (bugfix blanket)\n    Approved by:    ports-secteam (bugfix blanket)\n\ncommit 88d6f4488ab5\nAuthor: delphij <delphij@FreeBSD.org>\nDate:   Sun Nov 10 18:34:54 2019 +0000\n\n    Remove redundant pidfile check.\n\n    This fixes an issue that SSHguard won't start after an incompelete\n    shutdown.\n\n    PR:             ports/241751\n    Approved by:    portmgr (bugfix blanket)\n    MFH:            2019Q4\n\nPlease let me know if you need me to collect more data.\n\n[1] https://github.com/pfsense/FreeBSD-ports\n-- \nRenato Botelho\n"},{"id":"396130","messageId":"7dec4168-9eed-7f89-e33c-db0b50157407@gmail.com","threadId":"53299","inReplyTo":"7b4f2b10-e80d-d4af-6154-6665e37da623@FreeBSD.org","subject":"Re: Commit change disappeared from repository","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2020-04-24T13:21:20Z","receivedAt":"2020-04-24T13:21:25Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 4/23/2020 3:22 PM, Renato Botelho wrote:\n> Hello,\n> \n> I'm sending it here to devel list because after asking around at IRC and\n> also to friends we ended up with no reasonable explanation about what\n> happened, and it lead me to consider maybe it could be a bug (!?!?)\n\nThis is a common confusion with Git history. The best description of what\nis going on is [1], in my opinion.\n\n[1] https://docs.microsoft.com/en-us/azure/devops/repos/git/git-log-history-simplification\n\nThere are other history options that will likely show the error.\nSpecifically, run \"git log --full-history --simplify-merges <path>\" to\ndo a full graph traversal and reduce the output as much as possible.\n\n99% of these cases are due to someone resolving a merge conflict incorrectly,\nand you'll find that merge with the \"git log\" command above.\n\nThanks,\n-Stolee\n\n"},{"id":"396132","messageId":"21fa350c-37df-18b3-b577-2d2cb49b784d@FreeBSD.org","threadId":"53299","inReplyTo":"7dec4168-9eed-7f89-e33c-db0b50157407@gmail.com","subject":"Re: Commit change disappeared from repository","fromName":"Renato Botelho","fromEmail":"garga@freebsd.org","sentAt":"2020-04-24T14:34:49Z","receivedAt":"2020-04-24T14:34:55Z","isPatch":false,"sender":{"key":"garga@freebsd.org","avatar":"https://gravatar.com/avatar/695c68fb2f0629998c430204a7212aec683a3f87ec5eeaae236fd2376e790bfc?d=mp&s=160"},"body":"On 24/04/20 10:21, Derrick Stolee wrote:\n> On 4/23/2020 3:22 PM, Renato Botelho wrote:\n>> Hello,\n>>\n>> I'm sending it here to devel list because after asking around at IRC and\n>> also to friends we ended up with no reasonable explanation about what\n>> happened, and it lead me to consider maybe it could be a bug (!?!?)\n> \n> This is a common confusion with Git history. The best description of what\n> is going on is [1], in my opinion.\n> \n> [1] https://docs.microsoft.com/en-us/azure/devops/repos/git/git-log-history-simplification\n> \n> There are other history options that will likely show the error.\n> Specifically, run \"git log --full-history --simplify-merges <path>\" to\n> do a full graph traversal and reduce the output as much as possible.\n> \n> 99% of these cases are due to someone resolving a merge conflict incorrectly,\n> and you'll find that merge with the \"git log\" command above.\n\nThank you for the explanation!\n\n-- \nRenato Botelho\n"}]}