Skip to content

Rewrite delta merging to combine file creation and non-contiguous deltas with fuzzy matches #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

teliseo
Copy link

@teliseo teliseo commented Jan 31, 2025

SCCS deltas for initial file creation have a default comment containing a date string, such as:

date and time created 25/01/31 13:49:52 by teliseo

This causes the fuzzy matching which combines deltas to fail, so that each file create becomes a separate git commit. This pull request fixes this, allowing them to compare equal.

However, because all file creations are now more similar, it might be a good idea to adjust the default --fuzzy-commit-window down from one week to something like a few hours, at most.

@robohack
Copy link
Owner

Ah ha! Yes, of course including the initial revisions in the fuzzy matching is a good idea!

I'll have a look at this soon -- I have one (well, two, but only one this will affect) repository where I do ongoing maintenance in SCCS first and then do a "continuous" migration to git where I don't want to have to force-push any changes to the existing Git repo. I may have to add a workaround (probably just a command-line option to control it) to avoid that.

@teliseo
Copy link
Author

teliseo commented Jan 31, 2025

Ok, I’ve added a command-line option, and also working on some other related enhancements. Maybe wait a bit before merging this one.

- By default, this non-contiguous merging is enabled, but may be
  disabled using the --no-combine-separate option, restoring previous
  behavior.
- By default, the git commit gets the date of the latest SCCS delta, but this
  may be disabled using the --commit-date-earliest option, restoring previous
  behavior.
- Fix capitalization of help texts.

This implementation has one flaw: With non-contiguous merging and latest
commit date both enabled (the default), git commit timestamps may be
non-monotonic.
- Commits are reordered as necessary to guarantee monotonic commit timestamps
  even with non-contiguous merging, and using the latest delta timestamp as the
  commit timestamp (these methods are the current defaults).
- Ensure that multiple deltas of the same file can't be combined in one commit.
- Change --fuzzy-commit-window option to be an exclusive rather than inclusive
  bound so that 0 always creates one commit per delta (previously this behavior
  required the non-intuitive -1 to be specified).
@teliseo teliseo changed the title Fuzzy match deltas for file creation with default date-variant comments Rewrite delta merging to combine file creation and non-contiguous deltas with fuzzy matches Feb 2, 2025
@teliseo
Copy link
Author

teliseo commented Feb 2, 2025

I've added fuzzy merging of non-time-contiguous deltas, and other related improvements. See commit logs for details. Features which change the git commits all have options to revert to previous behavior.

@teliseo
Copy link
Author

teliseo commented Apr 26, 2025

Bump. After an encouraging initial reply by the maintainer, it’s now been nearly three months. Is there something I can do to assist in the review process of this or #2?

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