Closed ttuegel closed 8 years ago
I presume that any solution will need to retain the stateless quality of running emacs2nix
---since otherwise that effectively ties minimal diff generation to one machine.
The only option that I can see would be to query the git repository for when the recipe was last modified, and use that change id to construct the URL. I suspect it means that anyone running the process would have to have a complete copy of the repo---no shallow clones allowed---but that doesn't seem like a problem.
Does that sound like a reasonable strategy to you, or did you have something else in mind? I make absolutely no promises about how fast it would be for me to implement, but I'm good with git, and decent with Haskell, and it's an interesting problem....
It's much simpler than that! emacs2nix
takes the old package set as an input:
-- Roughly
emacs2nix :: PackageSet -> IO PackageSet
So, when we compute the hash of the recipe files (necessary for the fetchurl
call on the Nix side), we only use the new Git SHA if the hash of that recipe file has changed, otherwise we keep the old one.
Package recipes don't always need to come from the latest version of the MELPA repository. If a recipe's hash hasn't changed, there's no need to update the Git ref. This leads to generating much larger diffs than necessary.