Skip to content

Avoid git-switch for better backwards compatibility #29

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

Merged
merged 2 commits into from
Oct 20, 2022

Conversation

whoisninjaturtle
Copy link
Contributor

Replace git-switch commands with git-checkout equivalents for git < 2.23 compatibility

Replace git `switch` with `checkout` for backward compatibility
Remove comments
Copy link
Contributor

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

I had to go read up on the different orphan commands!

If you want to start a disconnected history... then you should clear the index and the working tree right after creating the orphan branch by running git rm -rf . from the top level of the working tree.

Looks good! Is this what you have been using? It works for you?

@whoisninjaturtle
Copy link
Contributor Author

whoisninjaturtle commented Oct 19, 2022

I configured a test machine with git > 2.23/Composer 2 and stepped through the original patch line-by-line while investigating the resulting branches. On a second machine, with git < 2.23 and Composer 1, I ran through the same process with my modified version of patch to compare the two workflows. As far as I can tell the only difference is that creating the orphan with switch automatically clears the working tree, while checkout does not.

I had to read up on it a little bit as well. To the best of my understanding, the switch command does not actually add any new functionality, at least not for our purposes here; it is simply a reorganization of existing functionality to improve naming and sometimes, like in the case of orphan branches here, add a little sugar behind the scenes that wasn't there before.

FWIW I use CI4 for work and I've already used this modified version of patch to start updating Production-level streams, so I feel fairly confident it's still doing what it should be.

@MGatner
Copy link
Contributor

MGatner commented Oct 20, 2022

My guy/gal! Thank you for your thoroughness: I am very happy to support this.

@MGatner MGatner merged commit 69a9d92 into tattersoftware:develop Oct 20, 2022
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