Alex Claman

A Brief Pacdiff Note



Another short note mostly so that I have this more readily at hand.

The pacdiff tool uses vimdiff, so the vim parts are already familiar.

The two key pacdiff option are -s (--sudo) and -b (--backup); both self-explanatory.

I found this comment on a Reddit post asking about pacdiff – the comment is the most useful part, therefore excerpting it here:

Simply type pacdiff -s and it will run sudoedit to merge the files. Use v to open vim with the pacnew file on the left, and the working file on the right with the focus on the pacnew file. Step through the changed hunks with ]c [move backward through the chunks with [c] and then dp to push the chunk to the working file, or edit the working file as you want. Then exit from vim and type r to remove the pacnew. Sometimes I may pull changes to the pacnew with do (e.g. if you mostly want the pacnew version) and then o to overwrite with pacnew.

This post has some more helpful detail if needed (although parts seem…different…from what comes up on my screen). There’s also a video linked in the Reddit post comments that has a helpful visual walkthrough of vimdiff, albeit in the context of git.