Yeah, it has been slowly growing on me 😜. But I would like to explore all other options before I fully commit.
You’ve already discovered the best editor. There’s no need to explore more. ;)
Unless you go in with a byte editor, you can’t change Mercurial’s commit history. I didn’t say “fabricate”, I said “change”.
In git you also cannot change history of a commit. You can only create a new commit with a new history. You’re arguing about semantics which don’t change the end result.
The point is, with Mercurial it would be hard and the result would be utterly incompatible with any other clone of the repo: there would be no way to propagate your changes to other clones. With git, this is a standard workflow.
As the example under discussion demonstrates, it’s also impossible to propagate the changes to git clones. Since history changed, merging the pull requests shows all the differences. That’s how Linus noticed the issue.
If it was compromised account trying to sneak code into the kernel, the attacker wouldn’t rewrite history since that would be obviously flagged when Linus tries to merge the pull request; as demonstrated by Linus in fact noticing the rewritten history. There was virtually no chance that this was an attack.
find -type f -exec chmod 644 -- {} +
find -type d -exec chmod 755 -- {} +
will only affect regular files and directories. There are other type
of files (specifically block and character devices, named pipes and
sockets) which those two commands would leave unaffected. In
practice, I suspect you don’t have any of those to worry about so you
can use -find f
.
So does it wait until it has found all the matches to run the command as a giant batch instead of running it as it finds matches?
Indeed. If possible, it is typically what you want (as opposed to find ... -exec ... {} \;
which runs command for each found file) since it will run faster. You want find ... -exec ... {} \;
if the command you’re executing can run on single file only or you’re dealing with legacy system without -exec ... {} +
support.
But I need x on directory, because that’s required to enter/read the directory. If I understand properly.
That’s why bacon listed find ${path} -type d exec chmod 750 {};
as first command. See also my reply.
Most user won’t notice.