Re: Automatically re-running commands during an interactive rebase or post commit
- From
Paul Jolly <paul@myitcv.io>
- Date
- May 29, 2023, 19:08 UTC
- Message-ID
- <CACoUkn4TOGi7xojSatEowF0CcFJHJof+F5XR-QtPTL5iznZDKw@mail.gmail.com>
- In-Reply-To
- <198eea19-fc40-de0c-8854-3cdc94925f32@gmail.com>
Hi Phillip,
Many thanks for your response.
> I think you could get around this by using a script that wraps "git > rebase". Something like
That's an interesting thought. I will give this some thought, thank you.
Show 7 quoted lines
> 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?
Best,
Paul