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 support for maintaining git history for both sides of the codemodded files #2361

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

void-mAlex
Copy link
Collaborator

create a branch for renaming both parts of the combined file to cause a conflict and show git which parts come from which file

… a conflict and show git which parts come from which file
@void-mAlex void-mAlex added the enhancement New feature or request label Mar 11, 2025
@davidtaylorhq
Copy link

I took a stab at implementing this technique in a standalone script, so you just pass it the base branch (e.g. main) and your codemodded branch. Very hacky so far, but it does seem to work: https://gist.github.com/davidtaylorhq/484505beccd5eeac1166bd75002b3e5a

Here's an example of the resultant commits: https://github.com/discourse/discourse/commits/codemod-squashed-example

And an example blame of a codemodded component: https://github.com/discourse/discourse/blame/codemod-squashed-example/app/assets/javascripts/discourse/app/components/avatar-uploader.gjs

(adding the codemod commit to .git-blame-ignore-revs was important, because otherwise the indentation change was showing in the blame for the entire template)

@ef4
Copy link
Contributor

ef4 commented Mar 11, 2025

Yes, we discussed that to really land this is should be a standalone command closer to that.

That history looks nice on GitHub. I didn't realize that GitHub supports .git-blame-ignore-revs by default.

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

Successfully merging this pull request may close these issues.

3 participants