this post was submitted on 11 Feb 2024
61 points (96.9% liked)
Linux
48220 readers
701 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Oh the whole previewing of changes thing, I guess I'd probably just use
git
, to easily roll back.I've tried it a couple times and can work in some contexts but becomes overly-complex in others. Example, if your fileset is not easily constrained by a single
git
repo. e.g. if there are multiple repos already existing. Or there are submodules. Or there are repos that have ignore files, but you want to include the files in the changes. Or there are a lot of files that chokegit
.Plus it doesn't really facilitate showing the changes that easily. I guess then you immediately go look at it with a diff tool and try to ascertain if it is screwed up or not? The kate component is nice because it shows you a list of changed files by filename/location, which you can expand to lines, and which you can easily open the whole file. Highlights the matches. Very quickly flick though everything for manual error checking. I haven't been able to find any diff tool that is as easy to use. (Would love to learn of one.)
And it still doesn't address the whole concept of saving the query.. I guess if you would write an individual bash script for every query? Then have a directory of those to somehow riffle through when needed?
All this sounds like something a computer would be great at managing but I am shit at managing.
Why not run sed and pipe to diff to preview changes?
You'd still have to manually copy out the command line to a notes file, but I don't think that that's too terrible. You could use a terminal-integrated snippets palette to make it a little smoother.
I'm not aware of any program that does exactly everything you want it to, so you might write your own or extend an existing one, as mentioned.