git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Commit change disappeared from repository
@ 2020-04-23 19:22 Renato Botelho
  2020-04-24 13:21 ` Derrick Stolee
  0 siblings, 1 reply; 3+ messages in thread
From: Renato Botelho @ 2020-04-23 19:22 UTC (permalink / raw)
  To: git

Hello,

I'm sending it here to devel list because after asking around at IRC and
also to friends we ended up with no reasonable explanation about what
happened, and it lead me to consider maybe it could be a bug (!?!?)

I'm running git 2.26.2 on macOS Catalina.

We first noted a package built from pfSense FreeBSD-ports repository [1]
was missing a patch and then after investigate we found these relevant
information (it's all about RELENG_2_4_5 branch):

1. The original commit made in Jan 3 is present in the repo:

❯ git log RELENG_2_4_5 | grep -A5 53e5b36834f1
commit 53e5b36834f1
Author: jim-p <jimp@netgate.com>
Date:   Fri Jan 3 11:50:09 2020 -0500

    Allow sshguard to process via stdin again. Issue #9971

2. Despite the fact commit was present, the change it introduced was not
present on repository contents.

3. This commit changed the file
security/sshguard/files/patch-src_sshguard.in as we can see:

❯ git show 53e5b36834f1 -- security/sshguard/files/patch-src_sshguard.in
commit 53e5b36834f1
Author: jim-p <jimp@netgate.com>
Date:   Fri Jan 3 11:50:09 2020 -0500

    Allow sshguard to process via stdin again. Issue #9971

diff --git a/security/sshguard/files/patch-src_sshguard.in
b/security/sshguard/files/patch-src_sshguard.in
index 6881e162028f..788f0ac2bc47 100644
--- a/security/sshguard/files/patch-src_sshguard.in
+++ b/security/sshguard/files/patch-src_sshguard.in
@@ -1,6 +1,6 @@
 --- src/sshguard.in.orig       2019-05-23 22:25:17 UTC
 +++ src/sshguard.in
-@@ -97,14 +97,8 @@ elif [ -z "$tailcmd" ]; then
+@@ -97,19 +97,12 @@ elif [ -z "$tailcmd" ]; then
      exit 1
  fi

@@ -17,3 +17,9 @@

  # Make sure to kill entire process group (subshell) on exit/interrupts.
  trap "clean_and_exit" INT TERM
+ trap "kill 0" EXIT
+
+ eval $tailcmd | $libexec/sshg-parser | \
+-    $libexec/sshg-blocker $flags | $BACKEND &
+-wait
++    $libexec/sshg-blocker $flags | ($BACKEND ; pkill -PIPE -P $$)

4. Here the odd facts start, git log doesn't show this commit when
filtering the file it changed, which btw, was never moved/renamed.

❯ git log RELENG_2_4_5 -- security/sshguard/files/patch-src_sshguard.in
commit 88d6f4488ab5
Author: delphij <delphij@FreeBSD.org>
Date:   Sun Nov 10 18:34:54 2019 +0000

    Remove redundant pidfile check.

    This fixes an issue that SSHguard won't start after an incompelete
    shutdown.

    PR:             ports/241751
    Approved by:    portmgr (bugfix blanket)
    MFH:            2019Q4

5. After trying to understand what happened, --follow parameter was used
and it shows that commit.  As I mentioned previously, the change it did
on that file was not there, and no other commit reverting it show up.

❯ git log RELENG_2_4_5 --follow -M --
security/sshguard/files/patch-src_sshguard.in
commit 53e5b36834f1
Author: jim-p <jimp@netgate.com>
Date:   Fri Jan 3 11:50:09 2020 -0500

    Allow sshguard to process via stdin again. Issue #9971

commit e4cccfc2c3ab
Author: delphij <delphij@FreeBSD.org>
Date:   Sun Nov 10 18:35:55 2019 +0000

    MFH: r517220

    Remove redundant pidfile check.

    This fixes an issue that SSHguard won't start after an incompelete
    shutdown.

    PR:             ports/241751
    Approved by:    portmgr (bugfix blanket)
    Approved by:    ports-secteam (bugfix blanket)

commit 88d6f4488ab5
Author: delphij <delphij@FreeBSD.org>
Date:   Sun Nov 10 18:34:54 2019 +0000

    Remove redundant pidfile check.

    This fixes an issue that SSHguard won't start after an incompelete
    shutdown.

    PR:             ports/241751
    Approved by:    portmgr (bugfix blanket)
    MFH:            2019Q4

Please let me know if you need me to collect more data.

[1] https://github.com/pfsense/FreeBSD-ports
-- 
Renato Botelho

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Commit change disappeared from repository
  2020-04-23 19:22 Commit change disappeared from repository Renato Botelho
@ 2020-04-24 13:21 ` Derrick Stolee
  2020-04-24 14:34   ` Renato Botelho
  0 siblings, 1 reply; 3+ messages in thread
From: Derrick Stolee @ 2020-04-24 13:21 UTC (permalink / raw)
  To: Renato Botelho, git

On 4/23/2020 3:22 PM, Renato Botelho wrote:
> Hello,
> 
> I'm sending it here to devel list because after asking around at IRC and
> also to friends we ended up with no reasonable explanation about what
> happened, and it lead me to consider maybe it could be a bug (!?!?)

This is a common confusion with Git history. The best description of what
is going on is [1], in my opinion.

[1] https://docs.microsoft.com/en-us/azure/devops/repos/git/git-log-history-simplification

There are other history options that will likely show the error.
Specifically, run "git log --full-history --simplify-merges <path>" to
do a full graph traversal and reduce the output as much as possible.

99% of these cases are due to someone resolving a merge conflict incorrectly,
and you'll find that merge with the "git log" command above.

Thanks,
-Stolee


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Commit change disappeared from repository
  2020-04-24 13:21 ` Derrick Stolee
@ 2020-04-24 14:34   ` Renato Botelho
  0 siblings, 0 replies; 3+ messages in thread
From: Renato Botelho @ 2020-04-24 14:34 UTC (permalink / raw)
  To: Derrick Stolee, git

On 24/04/20 10:21, Derrick Stolee wrote:
> On 4/23/2020 3:22 PM, Renato Botelho wrote:
>> Hello,
>>
>> I'm sending it here to devel list because after asking around at IRC and
>> also to friends we ended up with no reasonable explanation about what
>> happened, and it lead me to consider maybe it could be a bug (!?!?)
> 
> This is a common confusion with Git history. The best description of what
> is going on is [1], in my opinion.
> 
> [1] https://docs.microsoft.com/en-us/azure/devops/repos/git/git-log-history-simplification
> 
> There are other history options that will likely show the error.
> Specifically, run "git log --full-history --simplify-merges <path>" to
> do a full graph traversal and reduce the output as much as possible.
> 
> 99% of these cases are due to someone resolving a merge conflict incorrectly,
> and you'll find that merge with the "git log" command above.

Thank you for the explanation!

-- 
Renato Botelho

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-24 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 19:22 Commit change disappeared from repository Renato Botelho
2020-04-24 13:21 ` Derrick Stolee
2020-04-24 14:34   ` Renato Botelho

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).