Skip to content
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

Add Option to Exclude Destination Branch Changes #25

Open
ashutosh-dhse opened this issue Jul 1, 2024 · 2 comments
Open

Add Option to Exclude Destination Branch Changes #25

ashutosh-dhse opened this issue Jul 1, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ashutosh-dhse
Copy link

ashutosh-dhse commented Jul 1, 2024

Currently, the changes made are being determined by the command git diff <destination branch>..<source branch>. This command results in changes made in the destination branch as well.

Some CI tools have option to merge the source branch into the destination with the git clone step itself. In this case, changes made in the destination branch become irrelevant for determining the affected targets.

For these scenarios, we should use the git diff <destination branch>...<source branch> command to accurately determine the effective change set.

Proposal

Add one more command line option to exclude destination branch changes.

@ashutosh-dhse ashutosh-dhse added the enhancement New feature or request label Jul 1, 2024
@ashutosh-dhse ashutosh-dhse changed the title ### Title: Add Option to Exclude Destination Branch Changes Add Option to Exclude Destination Branch Changes Jul 1, 2024
@mikeger
Copy link
Owner

mikeger commented Jul 2, 2024

Hey, good point, let me check what can be done to achieve this.

@alexdeem
Copy link
Contributor

alexdeem commented Oct 2, 2024

Instead of passing the destination branch as the --base-branch argument try using git merge-base to find the best common ancestor between your source and destination branches. Using this commit at the --base-branch argument the tool will only consider the changes from the source branch back to that common ancestor.

example from my CI script:

MERGE_BASE=`git merge-base ${SOURCE_COMMIT} ${DESTINATION_BRANCH}`
echo "Merge Base: ${MERGE_BASE}"
mint run XcodeSelectiveTesting --base-branch ${MERGE_BASE}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants