News for hackers. Stuff that matters.

p_wood

> It’s much much better with moved code. > Delta adds color to the standard git diff algorithm.

Git will highlight moved code and delta shows that, so how does OmniDiff differ from

    git diff --color-moved=zebra --color-moved-ws=allow-indentation-change
Re:Pre-commit hooks are fundamentally broken on Saturday December 27, 2025 @01:39PM (#46404053)
> In my experience pre-commit hooks are most often used to generate a starting commit message.

The `prepare-commit-msg` hook is a better place to do that as it gives the hook some context about the commit (is the user amending an existing commit etc.)

> To put it even more bluntly, if you are trying to enforce proper formatting, pre-commit hooks are absolutely the wrong tool for the job, as hooks are trivially bypassable, and not shared when cloning a repo, by design.

They aren't a substitute for server post-receive hooks but they do help avoid having pushes rejected by the server.

Re:Show HN: Git-Add–Interactive with Enhancements on Tuesday June 03, 2025 @09:42AM (#44170042)
It would be really nice to have this upstream - I don't know if the upstream implementation being in C now makes that easier or harder. As for the license I think because this is so closely based on GPL code it would be safer to use the same license.
Re:Show HN: Git-Add–Interactive with Enhancements on Friday May 30, 2025 @03:22PM (#44139168)
I like the idea of 'G' to filter hunks. The perl script does not exist since git v2.40.0 so I don't think the installation instructions work for recent versions of git as there is no way to stop 'git add -p' from running the builtin version. I see this is MIT licenced but the code is very closely based on the perl script which is licensed under the GPLv2.
Re:Working with Git Patches in Apple Mail (2023) on Sunday May 18, 2025 @03:59PM (#44023934)
I use an app password but https://github.com/AdityaGarg8/git-credential-email apparently supports OAuth with Gmail, yahoo and outlook
Re:Use Long Options in Scripts on Saturday March 22, 2025 @11:15AM (#43446304)
> eval "$CMD"

That means you will eval all the filenames, so if you have a file with spaces in it will appear as two files, if there is a `$` in the name it will trigger parameter substitution and so on for the other shell meta-characters.

Re:Going down the rabbit hole of Git's new bundle-URI on Tuesday March 18, 2025 @06:49AM (#43397859)
> It’s frustrating that tarball urls are a proprietary thing and not something that was ever standardized in the git protocol.

`git archive --remote` will create a tarball from a remote repository so long as the server has enabled the appropriate config

Re:Going down the rabbit hole of Git's new bundle-URI on Tuesday March 18, 2025 @06:41AM (#43397816)
For rebasing `--reapply-cherry-picks` will avoid the annoying fetching you saw. `git backfill` is great for fetching the history of a file before running `git blame` on that file. I'm not sure how much it will help with detecting upstream cherry-picks.