News for hackers. Stuff that matters.
Re:Using Git add -p for fun (and profit) by spider-mario on Sunday December 14, 2025 @11:58AM (#46264536)
> I don't know if I've ever committed a file unintentionally since adopting it.

I’ve had the opposite problem: forgetting to add new files.

> I like it especially in concert with git commit --amend, which lets me tack my newest changes onto the previous commit. (Though an interactive rebase with fixup is even better)

No need for the rebase to be interactive:

    $ git commit --fixup=<commit>
    $ git rebase --autosquash <base>
Re:Using Git add -p for fun (and profit) by s1mplicissimus on Sunday December 14, 2025 @04:00PM (#46266825)
> I’ve had the opposite problem: forgetting to add new files.

Any good solutions for this around?

For now I've adopted running `git status` after `git add -p` to make sure there's no untracked files, but it feels a bit clunky

Re:Using Git add -p for fun (and profit) by 1718627440 on Sunday December 14, 2025 @04:24PM (#46267085)
You can run the tests on the actual produced commit, if you missed some files there would be a compilation error.
Re:Using Git add -p for fun (and profit) by kevinmchugh on Sunday December 14, 2025 @08:05PM (#46269079)
I occasionally forget to add a new file but don't mind it much. I consider it a significantly smaller problem than committing a file that shouldn't be. CI is gonna run and my tests are surely gonna fail if I didn't commit some file. So I'll see that and commit --amend or fixup to add the new file.

unless the file I forgot to commit is the tests, which hopefully I'll catch by the time of the PR