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 to preserve formatting (preserve tabs) #13

Open
glensc opened this issue Jul 14, 2019 · 2 comments
Open

Add support to preserve formatting (preserve tabs) #13

glensc opened this issue Jul 14, 2019 · 2 comments

Comments

@glensc
Copy link
Contributor

glensc commented Jul 14, 2019

I have tab indent formatted composer.json, each time composer-git-merge-driver is merging, the formatting is replaced with space indent.

@glensc glensc changed the title preserve tabs Add support to preserve formatting (preserve tabs) May 9, 2020
glensc added a commit to eventum/eventum that referenced this issue May 9, 2020
Too annoyed to reformat each time merge has been done as the merge
driver doesn't support this.

balbuf/composer-git-merge-driver#13
@balbuf
Copy link
Owner

balbuf commented Jun 22, 2020

@glensc these bits of logic were supposed to match the indentation and preserve the specific type of indentation (and in the case the case of spaces, the appropriate width), but I guess it isn't working properly?
https://github.com/balbuf/composer-git-merge-driver/blob/master/bin/composer-git-merge-driver#L27-L29
https://github.com/balbuf/composer-git-merge-driver/blob/master/bin/composer-git-merge-driver#L230-L235

It's limited in its ability because it just matches a sample line and extrapolates for the rest of the file, so if there's a mixture of spaces/tabs or other nonstandard indentation (or if the indentation type was changed during the merge), it's not going to faithfully preserve the indentation. If you want to look into what the issue is, those would be the places to start.

@glensc
Copy link
Contributor Author

glensc commented Jun 25, 2020

@balbuf thanks for the investigation. I've converted muy files to space indent, so this is no longer bothering me.

ps:

🚧 Never link to branches, share a permalink 🚧

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

No branches or pull requests

2 participants