I'm maintaining a customized version of a Ghost theme on GitHub. it's taking in a regular stream of changes from the main TryGhost/Casper repo which isn't too hard to keep track of.
There is one thing that's bothering me and that has to do with the custom-*.hbs files in my theme. Whenever Ghost updates the post.hbs, I must remember to merge those changes into each custom-*.hbs template as well.
Is there a way I can tell Git that post.hbs's changes must always be merged into multiple files on my end?
post.hbs->post.hbspost.hbs->custom-blogger.hbspage.hbs->page.hbspage.hbs->custom-training.hbs- etc
The repo, as it is currently, can be found here:
For now, I've resorted to manually diffing the changes and applying them to the related files.
The short answer is no, which is a bit unfortunate.
When Git is doing a true merge—a "merge as a verb", as I like to call it—Git works with three commits: the merge base, which Git finds on its own, and two tip commits. One of the tip commits is always
HEAD, by definition, and the other is usually identified by some branch name:All three commits are snapshots of all files, as usual. Git performs the merge—combines the different changes since the merge base—by, in effect, running:
Git then combs through these differences—the change-sets produced by the two diff commands—and pairs up files, so that it knows that
file.extin the base is the same file asfile.extin ours and/or in theirs.If the rename-detector detects that
file.extin the base has becomenewname.extin our commitX, Git knows that it should combine the changes they made tofile.extto the changes we made tonewname.ext-vs-file.ext, storing the final result innewname.ext. But this is strictly pairwise. Althoughgit diffsupports several "find copies" options, there is no "find copies" option togit merge. Furthermore, there is no "break existing pairing" option (git diffhas one,-Bwith a threshold, similar to-Mfor rename-finding and-Cfor copy-finding): if the merge base and one tip contains a file whose path is P, that file-pair is paired for the duration of the merge. If the merge base and the other tip contains a file whose path is P, that file-pair is likewise paired.Hence, if your merge base contains
post.hbsand both tips containpost.hbs, the pairing is strictlypost.hbs = post.hbs.