Better HN
topnewbestaskshowjobs
Log inSign up

p_wood

2 karma · joined Mar 18, 2025 (1y ago) · 8 submissions

Submissions

comment 3w ago · link · parent

> 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

comment 11mo ago · link · parent

> 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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

I use an app password but https://github.com/AdityaGarg8/git-credential-email apparently supports OAuth with Gmail, yahoo and outlook

comment 1y ago · link · parent

> 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.

comment 1y ago · link · parent

> 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

comment 1y ago · link · parent

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.