8 ms·
I've tried to use git notes over the years but unfortunately notes are tied to a specific commit hash. It's a blessing and a curse. Works great for some types
by mfontani 4y ago
I've tried to use git notes over the years but unfortunately notes are tied to a specific commit hash. It's a blessing and a curse.
Works great for some types of review system, or for "tagging" things related to deploy. Notes on commits on the master/main branch, which doesn't get rebased? Awesome thing, they work.
But you can't as easily use them on branches: the moment a branch whose commits had notes is rebased, and SHAs change, good-bye notes associated with the "previous" SHAs :/
- l0b0 4y agoDo you need to `git config notes.rewriteRef refs/notes/commits`[1]? [1] https://stackoverflow.com/a/14601464/96588 https://stackoverflow.com/a/14601464/96588
- metafunctor 4y agoI had no idea this even existed, and I've run into this problem with notes myself! This seems like something that should be a default.
- hypothesis 4y agoSeems like a standard git thing: have a process that works in a specific, but not a “helpful” way and also have a undiscoverable setting to configure said process. Is that why people keep building UIs and wrappers for git?
- TylerE 4y agoHaving lots of config is fine, even good, if you ship sane defaults. Frankly most OSS flunks this, and git is one of the biggest offenders.
- rjh29 4y agoGit has so many users that changing defaults is pretty tricky. They have done it in the past but usually over multiple release cycles with a deprecation window.
- skissane 4y agoMaybe they should introduce an option to configure which set of defaults is used. e.g. defaults=traditional adopts current defaults (that maximise backward compatibility) defaults=latest adopts latest recommended defaults (better out-of-box user experience, but may break things which depend on the traditional settings) Then at least there is only one setting to change to get sane defaults. Maybe even, defaults=VERSION to give you latest defaults as per that version.
- nordsieck 4y ago> Maybe they should introduce an option to configure which set of defaults is used. > ... > Then at least there is only one setting to change to get sane defaults. I suspect that, much like C++, there will be fierce debate over exactly what constitutes sane defaults.
- bacon_waffle 4y agoMaybe there could be a "C++ style defaults" set of configuration, as default?
- jamesfinlayson 4y agoLike Apache's default settings working well for a site that gets no more than one visitor a minute.
- kenzniik 4y agoAh yes, like how nginx’s defaults still like to pretend it’s early 2000s, everyone uses dialup, and nobody could possibly want their website to serve more than a handful of requests per hour.
- stevage 4y agoYep. The default options are usually the wrong ones.
- hakre 4y agoDepends. You can also see those as notes and you want to have them go away after rebase automatically so you have invalidation built in (e.g. preparing changes).
- nerdponx 4y agoMy guess is that it was originally an oversight and this option was added later, but turned off by default to avoid a "breaking change". Would be interesting to dig through the changelogs and commit history to see what the story was.
- hakre 4y agoYes, it is totally possible to guess it this way. From top of my head reference rewriting while rebase is older thought, but I'd be clueless about it apart from that rebasing is for rewriting commit references in the first place. And everything else - including git-note references - needs to be explicitly configured from that default behaviour. Which follows your argument in a broader sense, as per default no other refs are expected to get rewritten and therefore it shouldn't be different for git-notes, even if they were introduced with the configuration option to rewrite them in the first place.
- YetAnotherNick 4y agoNot completely sure but seems like a problem that could be solved using pre-rebase hook.
- fmajid 4y agoAnother reason to never rebase.