NHacker Next
login
▲Modifying other people's softwarenatkr.com
33 points by todsacerdoti 4 days ago | 15 comments
Loading comments...
skydhash 2 hours ago [-]
Maybe I can't understand what TFA is describing, but from what I know a patch is usually tied to a specific commit, so a very specific point of time in the upstream lifetime. It does not make sense to have it lingering longer than that. Even in the case when you want to maintain a set of patches (package building,...) you usually revise it every new version of the software. In this case, the intent is much more important than the how (which quickly become history).
doix 48 minutes ago [-]
Yes, I don't quite get it. When I need to maintain a fork, I just add an extra remote to git. Then I fetch upstream (what I call my remote) and rebase my changes against whatever branch I'm following. At any point in time I can generate a patch file that works for whatever version I have rebased against.

Seems easy enough, I read the article multiple times and I don't get why what they are describing is needed.

Nullabillity 26 minutes ago [-]
(Author here.)

The difference is that git rebasing is a destructive operation, you lose track of the old version when you do it. (Yes, there's technically the reflog.. but it's much less friendly to browse, and there's no way to share it across a team.)

Maybe that's an okay tradeoff for something you use by yourself, but it gets completely untenable when you're multiple people maintaining it together, because constantly rebasing branches completely breaks Git's collaboration model.

cobbzilla 21 minutes ago [-]
I see — you’re doing more than “here’s a few patches to keep working across revisions”, you’re doing separate-path feature work on a different, actively-developed project.

To me that sounds like not a great idea, but if you must do it, I could see some usefulness to this.

Nullabillity 12 minutes ago [-]
Yeah. For reference, this is a typical patchset for the project that motivated it.[0] Some of the patches are "routine" dependency upgrades, some of them are bugfix backports, some of them are original work that we were planning to upstream but hadn't got around to yet. Some are worth keeping when upgrading to a new upstream version, some aren't.

I agree that it's not ideal, but... there are always tradeoffs to manage.

[0]: https://github.com/stackabletech/docker-images/tree/e30798ac...

cobbzilla 27 minutes ago [-]
Agreed. If you want your change and don’t want to bother the maintainers with a patch they are unlikely to accept, or can’t because it’s proprietary: fork the repo (at whatever tag makes sense), then periodically sync with the latest code for that version.

The likelihood of conflicts is minimal, and often if you see conflicts it’s a good indication your issue may have been resolved. Or if not, you can see if it’s still needed, or how to adjust it.

Nullabillity 19 minutes ago [-]
(Author here.)

> fork the repo (at whatever tag makes sense), then periodically sync with the latest code for that version.

Yeah, this is the workflow that Lappverk is trying to enable.

The problem is that neither of Git's collaboration models works well for this problem. Rebasing breaks collaboration (and history for the patchset itself), and merging quickly loses track of individual patches. Lappverk is an attempt to provide a safer way to collaborate over the rebase workflow.

shmerl 6 minutes ago [-]
Yeah, that's how I understood it. For example wine-staging (ran by Wine developers themselves) hosts patches for Wine project and they revise / rebase them with each Wine version, which is often not a trivial task. I don't see how you can avoid that really. But Wine staging itself is a git repository that holds patches (and their history) if that helps, which indeed can stay there for years.

Same happens with patches that Debian applies on top of fixed versions of packages. They are stored in Debian's Salsa git.

what 54 minutes ago [-]
A patch just encapsulates what was added and removed in a particular change, it doesn’t care about any commits.
userbinator 3 hours ago [-]
Many times I've just patched the binary even if source is available, because trying to reproduce the binary you currently have, with only the changes you want and everything else the same, can be an even more difficult exercise than simply changing a string or constant.
taneq 21 minutes ago [-]
Especially if you make a habit of patching the binary instead of rebuilding from source! ;)
thwarted 3 hours ago [-]
The process described reminded me of "pristine source" and RPM spec files that take the upstream pristine source and patch it during the build process. Maintaining that is always a little bit of a headache if you don't do it regularly, especially having to maintain (generate and apply) a separate set of patch files for the changes and express/apply the patches in the spec file. This looks to make light work of that.
datadrivenangel 3 hours ago [-]
Modifying source code like this is one method. For web software, bookmarklets are another great way to do that.
bartread 2 hours ago [-]
I’m a big fan of Greasemonkey scripts for this, although these days I prefer Violentmonkey because it has several capabilities that the OG doesn’t.
cyberax 3 hours ago [-]
This is supercool. One my constant problem with self-hosting is that I often need to modify just a couple of files here and there, but then I'm stuck with a forked repo or a dirty work copy.

I'm going to try to make a frontend UI for it.