git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Phillip WoodNext: Phillip Wood
Message 6 of 13 in “Automatically re-running commands during an interactive rebase or post commit”
  1. Paul JollyMay 29, 2023
  2. rsbecker@nexbridge.comMay 29, 2023
  3. Paul JollyMay 29, 2023
  4. Paul JollyMay 29, 2023
  5. Phillip WoodMay 29, 2023
  6. Paul JollyMay 29, 2023
  7. Phillip WoodMay 29, 2023
  8. Elijah NewrenMay 31, 2023
  9. Phillip WoodJun 2, 2023
  10. Paul JollyJun 8, 2023
  11. Son Luong NgocMay 30, 2023
  12. Oswald BuddenhagenMay 30, 2023
  13. Paul JollyMay 30, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.