Live data from Hacker News

Git Notes: Git's coolest, most unloved­ feature (2022)

tylercipriani.com

41–50 of 147 posts

Re: Git Notes: Git's coolest, most unloved­ feature (2022)

#41

What happens of you rebase a branch containing commits with notes attached?

Check the notes.rewrite config options in https://git-scm.com/docs/git-notes#Documentation/git-notes.t... Also notes.rewriteRef. You can use these to configure git to carry your notes across amend/rebase.

Re: Git Notes: Git's coolest, most unloved­ feature (2022)

#42

Earlier quoted context omitted.

One more similar feature from a different system: PostgreSQL COMMENT https://www.postgresql.org/docs/17/sql-comment.html This allows you to attach text to various database objects in PostgreSQL. I wish PostgreSQL had a feature that was more like structured key-value database object metadata that could be edited.

I love PostgreSQL COMMENT. I built a prototype app for a buddy with Supabase and added a COMMENT to every table.

with supabase it is almost essential. But adding comments with migrations is somewhat tedious, unless you're writing actual sql. Like, you know, with supabase.

Re: Git Notes: Git's coolest, most unloved­ feature (2022)

#43
post #25

In practice I get a lot of value out of referencing commit hashes. If I fix a problem I introduced in a previous commit (for example, commit bumped version, and I forgot to bump it somewhere), my fix will say "amends ab12cd34". That way when I need to cherry-pick that commit, or do something similar (bump again), I can search for the hash of the commit I'm looking at to find what might be missing. UI is worse than gi…

you kinda doing by hand what git commit --fixup could do for you, and what git rebase -i could pick up automatically.

Re: Git Notes: Git's coolest, most unloved­ feature (2022)

#44
I think it would be interesting to add the prompt (or a summary of the prompt) as a note for each commit. This would allow the LLM to later reason about each line of code by going back and checking the notes to mine for requirements, and take those into account when changing the code again.

Re: Git Notes: Git's coolest, most unloved­ feature (2022)

#45
post #8

i use git notes pretty heavily in my current role. started as an experiment to keep track of internal code reviews without flooding the commit message or making PRs for everything. i tag every commit with context what tickets it maps to, infra constraints, links to incident threads if it's a fix. all lives in the repo. this avoids the need to grep slack or jira just to know why a line changed. nce you start using it…

Shouldn’t that be the commit message ? Or is the goal to also link forward in time, such as “we realised this commit introduced bug #123” ?

Re: Git Notes: Git's coolest, most unloved­ feature (2022)

#48
post #8

i use git notes pretty heavily in my current role. started as an experiment to keep track of internal code reviews without flooding the commit message or making PRs for everything. i tag every commit with context what tickets it maps to, infra constraints, links to incident threads if it's a fix. all lives in the repo. this avoids the need to grep slack or jira just to know why a line changed. nce you start using it…

Shouldn’t that be the commit message ? Or is the goal to also link forward in time, such as “we realised this commit introduced bug #123” ?

haha wait do you actually read long commit messages( more than a line) all the way through? like line-by-line, imo commit msg = tweet, git note = blog post.

Re: Git Notes: Git's coolest, most unloved­ feature (2022)

#49

There are many "Git's coolest, most unloved feature", e.g.: bisect, pickaxe, reflog, range-diff, archive, annotated tags, etc. Sadly they are often forgotten as many people thing of Git only as a glorified Google Drive...

Git notes is redundant since you need a higher-level project management tool to track features anyway. Roadmaps, feature hierarchy and non-technical details. Think of any big tracker or Jira.

I think that's fine. Unix philosophy is to focus on one thing and do that well.

Re: Git Notes: Git's coolest, most unloved­ feature (2022)

#50

Another little-known feature is git trailers: https://alchemists.io/articles/git_trailers These are key-value structures data that can be included on a commit when it is created. These are used by some systems for attaching metadata. For example, Gerrit uses this for attaching its Change-Id.

Interesting, I wasn't familiar with this feature.

I'm a big fan of conventional commits, and trailers seem like a better way of adding such metadata.

Is adding them manually to the commit message functionally equivalent to using the `--trailer` flag?

Post reply on HN