Skip to content

Initial version of a git_bdiff module#100

Merged
Erica Neininger (ericaneininger) merged 9 commits into
mainfrom
git_bdiff
Jul 23, 2025
Merged

Initial version of a git_bdiff module#100
Erica Neininger (ericaneininger) merged 9 commits into
mainfrom
git_bdiff

Conversation

@t00sa

Copy link
Copy Markdown
Collaborator

Description

Summary

A simple module that wraps around git diff and generates a complete list of files changed on a branch since it diverged from the parent. This is intended to replace the functionality of fcm_bdiff when we move the repositories to git.

Changes

New python module plus some tests

Dependency

None

Impact

None

Issues addressed

#86

Coordinated merge

None

Checklist

  • I have performed a self-review of my own changes

A simple module that wraps around git diff and generates a complete
list of files changed on a branch since it diverged from the parent.
This is intended to replace the functionality of fcm_bdiff.
Allow the constructor to specify the path to a repository and update
the run_git method to change to the directory before running each git
command.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comments inline.

Comment thread bdiff/git_bdiff.py Outdated
Comment thread bdiff/tests/test_git_bdiff.py Outdated

@r-sharp R Sharp (r-sharp) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Whilst i can see this rather replicates the behaviours of the "fcm_bdiff.py" script used to get info out of the fcm/svn based repos, and thus should work as an almost 'drop in' replacement for the fcm_bdiff.py utility....
There are 'other' utility scripts/routines which do similar things for other fcm commands...
What I would have realy liked to see was something that created a 'class' containing all the info gathered about a branch (so perhaps making each 'get' return a value or if that value has not been generated yet, then generate it - singleton style)

I appreciate that's a big - change to ask for at this stage, so I'm not asking for it. What I am asking for is a possible re-name of the file so that when it hopefully 'morphs' into something which can gather and store all the info we like to know about a branch, it doesn't feel misnamed...

Comment thread bdiff/git_bdiff.py Outdated
Comment thread bdiff/git_bdiff.py
Comment thread bdiff/git_bdiff.py Outdated
Comment thread bdiff/git_bdiff.py
Comment thread bdiff/git_bdiff.py
Comment thread bdiff/git_bdiff.py
Comment thread bdiff/git_bdiff.py Outdated
Comment thread bdiff/tests/test_git_bdiff.py
Comment thread bdiff/tests/test_git_bdiff.py Outdated
Comment thread bdiff/tests/test_git_bdiff.py

@t00sa Sam Clarke-Green (t00sa) left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, plenty of good things to think about and polish up 🤔

Comment thread bdiff/git_bdiff.py
Comment thread bdiff/git_bdiff.py Outdated
Comment thread bdiff/git_bdiff.py Outdated
Comment thread bdiff/git_bdiff.py
Comment thread bdiff/git_bdiff.py
Comment thread bdiff/tests/test_git_bdiff.py Outdated
Comment thread bdiff/tests/test_git_bdiff.py
Comment thread bdiff/tests/test_git_bdiff.py
Comment thread bdiff/tests/test_git_bdiff.py Outdated
Comment thread bdiff/git_bdiff.py
Add string comparisons to existing exception tests and add a couple of
exception handling tests for the git_run method to improve testing
coverage.
Reviewer has recommended changing the pattern match to require a full
40 character hex string.
This improves the pattern used to match the branch to make it closer
to the official git definition.  The pattern does not need to include
all the defined by git check-ref-format because the branch name must
already be compliant with these in order to be created in the first
place.

@r-sharp R Sharp (r-sharp) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks to be an improvement on the fcm version, and it's got unit tests....

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Happy with the additional mods. Approved.

@ericaneininger
Erica Neininger (ericaneininger) merged commit 7a8809d into main Jul 23, 2025
8 checks passed
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.

4 participants