Re: Automatically re-running commands during an interactive rebase or post commit
From: Phillip Wood <hidden>
Date: 2023-05-29 19:49:03
Hi Paul On 29/05/2023 20:08, Paul Jolly wrote:
Hi Phillip, Many thanks for your response.quoted
I think you could get around this by using a script that wraps "git rebase". Something likeThat's an interesting thought. I will give this some thought, thank you.quoted
I did wonder if you could use a custom merge driver (see man gitattributes) for the file with the checksums but that would be run before all the other files have been merged. Another alternative might be to use a custom merge strategy that runs "git merge-ort" and then cleans up the conflicts in the checksum file. You can specify a custom strategy by naming your script "git-merge-foo" and passing "-s foo" to git rebase.This approach with a custom merge strategy is very much closer to what feels like it will work best. I just gave this a try, and I seem to be falling at somewhat the first hurdle. I have a custom merge strategy working, insofar as I've written a script that is being called. The script simply wraps "git merge-ort" as you suggest. But I can't seem to work out how to actually run 'git merge-ort'! I've tried 'git merge -s "$@"' in my wrapper script, but doing so my custom strategy behaves differently to if I use no strategy, which seems to suggest I'm doing something wrong. Do you have any suggestions/pointers?
Sorry, I'd assumed there was a merge-ort command in the same way as there is a merge-recursive command but it does not exist. I think the best you can do is run "git merge-recursive" rather than "git merge-ort" in your script. I've cc'd Elijah in case he has a better suggestion. Best Wishes Phillip
Best, Paul