Skip to content

Conversation

@bryango
Copy link
Contributor

@bryango bryango commented Oct 14, 2024

This makes use of insta's filters feature.

Comment on lines 595 to 602
insta::with_settings!({filters => vec![
// ignore no-op checkouts, which is present in e.g. git 2.43
// but disappears in e.g. git 2.46
(r"\n2\. Check out from 94b1077 create file1.txt\s*to 94b1077 create file1.txt\n", "\n"),
// ignore different numbering of events
(r"(?m)^[0-9]+\. ", "#. "),
("Applied ([0-9]+) inverse events.", "Applied # inverse events."),
]}, {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting! I didn't know about insta filters. So the idea for these no-op checkouts is that they were introduced into git and then quickly-but-not-quickly-enough removed again?

FYI I also see some of these no-op checkout messages in test_undo_garbage_collected_commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think so! Back then I discovered insta's filter feature and was trying to fix some trivial test failures for newer versions of git, but it was a bit tedious so I didn't finish 🤣 Day job has now caught up with me so I will have to rebase and fix stuff next weekend, but feel free to take the ideas here and reuse them!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I also see some of these no-op checkout messages in test_undo_garbage_collected_commit.

These no-op checkouts seem to persist as of git v2.51.2, and I have no idea what is happening haha...

@bryango
Copy link
Contributor Author

bryango commented Dec 8, 2025

Testing on git v2.51.2 it seems that there are still numerous test failures that I do not understand. The most frequents ones are similar to the following:

---- test_sync_basic stdout ----
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: sync_basic-2
Source: git-branchless/tests/test_sync.rs:47
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Expression: stderr
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────
    0     0 │ branchless: creating working copy snapshot
          1 │+branchless: processing 1 update: ref HEAD
    1     2 │ Switched to branch 'master'
    2     3 │ branchless: processing checkout
    3     4 │ branchless: creating working copy snapshot
          5 │+branchless: processing 1 update: ref HEAD
    4     6 │ Switched to branch 'master'
    5     7 │ branchless: processing checkout
────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────

I guess this one is harmless but I don't actually understand it...

@bryango bryango marked this pull request as ready for review December 8, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants